Skip to content
Snippets Groups Projects
idabot.rst 1.85 KiB
Newer Older
  • Learn to ignore specific revisions
  • David Bergström's avatar
    David Bergström committed
    IDABot
    ======
    
    .. class:: library.IDABot
    
       This is the basis of your bot. It contains all available managers and some
       methods to get you started.
    
    
       See :ref:`this page <gettingstarted>` for how to properly
    
    David Bergström's avatar
    David Bergström committed
       inherit from IDABot.
    
       Instances of managers:
    
       .. attribute:: IDABot.base_location_manager
    
          An instance of the class :class:`library.BaseLocationManager`
    
       .. attribute:: IDABot.tech_tree
    
          An instance of the class :class:`library.TechTree`
    
       .. attribute:: IDABot.map_tools
    
          An instance of the class :class:`library.MapTools`
    
       .. attribute:: IDABot.building_placer
    
          An instance of the class :class:`library.BuildingPlacer`
    
    
       Inherited methods:
    
       .. method:: IDABot.on_game_start(self)
    
          This method when Starcraft has stared, when you inherit it you have to
    
          call the parent's on_game_start method in order to make it work (see
    
          :ref:`gettingstarted`).
    
       .. method:: IDABot.on_step(self)
    
          This method is run on every tick of the game, when you inherit it you
          have to call the parent's on_step method in order to make it work (see
          :ref:`gettingstarted`).
    
    
    David Bergström's avatar
    David Bergström committed
       Methods:
    
       .. method:: IDABot.get_all_units(self) -> List[library.Unit]
    
          Retrieves a list of all visible units
    
       .. method:: IDABot.get_my_units(self) -> List[library.Unit]
    
          Retrieves a list of all your visible units
    
       .. method:: IDABot.get_player_race(self) -> library.Race
    
          Returns the players race, useful if you play Race.Random
    
    
       .. method:: IDABot.send_chat(self, message)
    
          Sends the string 'message' to the game chat
    
    
       .. method:: IDABot.carry_vespene(self, unit) -> Boolean
     
          "Returns true if unit carries a vespene"
    
    
    David Bergström's avatar
    David Bergström committed
       Attributes:
    
       .. autoattribute:: minerals
    
       .. autoattribute:: gas
    
       .. autoattribute:: current_supply
    
       .. autoattribute:: max_supply
    
    
       .. autoattribute:: current_frame