Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Managers
========
The original CommandCenter bot uses managers to do everything, having managers
manage workers, building, controlling military etc. In this API we have removed
all the control related managers and only kept the managers related to helping
process input information, leaving the decision-making to the user of the API.
Here is a full list of all managers:
* :class:`library.BaseLocationManager`
* :class:`library.TechTree`
The rest of this page contains the descriptions of each manager.
.. TODO: How should we access the managers? Should we let the students create them themselves or should we give it to them via inhertiance
BaseLocationManager
-------------------
.. class:: library.BaseLocationManager
.. attribute:: library.BaseLocationManager.base_locations
A list of all :class:`library.BaseLocation` on the current map
.. attribute:: library.BaseLocationManager.starting_base_locations
A list of all :class:`library.BaseLocation` on the current map which a player
started at, indexed by Player constant
.. automethod:: library.BaseLocationManager.get_occupied_base_locations
.. automethod:: library.BaseLocationManager.get_player_starting_base_location
.. automethod:: library.BaseLocationManager.get_next_expansion
.. class:: library.BaseLocation
Closely related to BaseLocationManager. This is the datastructure used by
the BaseLocationManager to keep track of all base locations and related
information.
.. attribute:: library.BaseLocation.position
The position of the center of the BaseLocation, defined as a :class:`library.Point2D`.
.. attribute:: library.BaseLocation.depot_position
A suitable position for building a town hall, defined as a :class:`library.Point2DI`.
TechTree
--------
.. class:: library.TechTree
This class contains all information about units and what is required to
build a certain unit and what builds it. It only has one method, which is
used to look-up unit types properties:
.. method:: get_data(argument) -> library.TypeData
Argument is either an instance of the class :class:`library.UnitType` or
an instance of the class :class:`library.CCUpgrade`, depending on what
information is wanted.
.. autoclass:: library.TypeData
:members:
.. TODO: Not all members have docstrings attached to them
MapTools
--------
.. autoclass:: library.MapTools
:members: