Skip to content
Snippets Groups Projects
helpers.rst 2.74 KiB
Newer Older
Helpers
=======
David Bergström's avatar
David Bergström committed

There are several classes related to processing information about the game
Daniel de Leng's avatar
Daniel de Leng committed
state and the input from StarCraft II. All these classes are taken more or less
directly from the original `CommandCenter`_, but we have left all
decision-making to the user of the API.
.. _CommandCenter: https://github.com/davechurchill/commandcenter
David Bergström's avatar
David Bergström committed

Here is a full list of all managers:

* :class:`commandcenter.BaseLocationManager`
* :class:`commandcenter.TechTree`
* :class:`commandcenter.MapTools`
* :class:`commandcenter.BuildingPlacer`
David Bergström's avatar
David Bergström committed

David Bergström's avatar
David Bergström committed
The rest of this page contains a brief description of each manager.
David Bergström's avatar
David Bergström committed

BaseLocationManager
-------------------

.. class:: commandcenter.BaseLocationManager
David Bergström's avatar
David Bergström committed

   .. autoattribute:: base_locations
David Bergström's avatar
David Bergström committed

   .. autoattribute:: starting_base_locations
David Bergström's avatar
David Bergström committed

   .. automethod:: get_occupied_base_locations
David Bergström's avatar
David Bergström committed

   .. automethod:: get_player_starting_base_location
David Bergström's avatar
David Bergström committed

   .. automethod:: get_next_expansion
David Bergström's avatar
David Bergström committed

.. class:: commandcenter.BaseLocation
David Bergström's avatar
David Bergström committed

   Closely related to BaseLocationManager. This is the datastructure used by
   the BaseLocationManager to keep track of all base locations and related
   information.

   .. autoattribute:: position
   .. autoattribute:: depot_position

   .. autoattribute:: minerals

   .. autoattribute:: geysers

   .. automethod:: get_ground_distance

   .. automethod:: is_occupied_by_player

   .. automethod:: is_player_start_location

   .. automethod:: contains_position
David Bergström's avatar
David Bergström committed


TechTree
--------

.. autoclass:: commandcenter.TechTree
David Bergström's avatar
David Bergström committed

   This class has some invalid information by default, this can be corrected by
   placing the file `techtree.json` in the working directory. The
   `techtree.json` files are available here_, select the lastest version.
Daniel de Leng's avatar
Daniel de Leng committed
   A techtree for StarCraft II version >=4.10 is now available (not fully tested yet),
   this can be found under the folder data in this link_.
   A recent file is included in the `template repository`_.
   .. automethod:: get_data(argument) -> commandcenter.TypeData
David Bergström's avatar
David Bergström committed

.. _link: https://github.com/BurnySc2/sc2-techtree
.. _here: https://github.com/noorus/sc2-gamedata
.. _`template repository`: https://gitlab.liu.se/starcraft-ai-course/sc2-python-bot
.. autoclass:: commandcenter.TypeData
David Bergström's avatar
David Bergström committed
   :members:
   :undoc-members:

.. TODO: Types for all fields would be nice, is required_units List[UnitType] or List[UNIT_TYPEID]?
David Bergström's avatar
David Bergström committed

MapTools
--------

.. autoclass:: commandcenter.MapTools
David Bergström's avatar
David Bergström committed
   :members:
   :undoc-members:

David Bergström's avatar
David Bergström committed

.. autoclass:: commandcenter.Color 	
David Bergström's avatar
David Bergström committed
   :members:
   :undoc-members:

   .. automethod:: __init__
DistanceMap
~~~~~~~~~~~

.. autoclass:: commandcenter.DistanceMap
   :members:
   :undoc-members:
BuildingPlacer
--------------

.. autoclass:: commandcenter.BuildingPlacer 	
   :members:
   :undoc-members:
Daniel de Leng's avatar
Daniel de Leng committed
.. toctree::