From 41e7aa5f77f0299d20b80918fa057a9bbf9c5d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Bergstr=C3=B6m?= <davbe125@student.liu.se> Date: Thu, 2 Aug 2018 11:44:52 +0200 Subject: [PATCH] Add some documentation on player constants --- docs/index.rst | 5 +---- docs/playerconstants.rst | 12 ++++++++++++ docs/unit.rst | 5 +++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 docs/playerconstants.rst diff --git a/docs/index.rst b/docs/index.rst index 4567262..4fdbdac 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,6 +9,7 @@ This is a Python module for implementing bots for Starcraft II. unit managers + playerconstants Short overview ============== @@ -17,10 +18,6 @@ Short overview :toctree: _autosummary library - library.PLAYER_SELF - library.PLAYER_ENEMY - library.PLAYER_NEUTRAL - library.PLAYER_ALLY library.ABILITY_ID library.BUFF_ID library.BaseLocation diff --git a/docs/playerconstants.rst b/docs/playerconstants.rst new file mode 100644 index 0000000..20f5d83 --- /dev/null +++ b/docs/playerconstants.rst @@ -0,0 +1,12 @@ +Player constants +================ + +The following constants are used when referring to a player: + +.. autoclass:: library.PLAYER_SELF +.. autoclass:: library.PLAYER_ENEMY +.. autoclass:: library.PLAYER_NEUTRAL +.. autoclass:: library.PLAYER_ALLY + +These are internally represented as integers, but these constants should be +used instead to avoid confusion. diff --git a/docs/unit.rst b/docs/unit.rst index c07a12a..0016204 100644 --- a/docs/unit.rst +++ b/docs/unit.rst @@ -38,6 +38,11 @@ Unit .. attribute:: Unit.player .. TODO: Add page about PLAYER_* constants + + Returns the constant corresponding to player which this unit belongs to. + See the page :doc:`playerconstants` for more information on player + constants. + .. autoattribute:: position .. autoattribute:: shields .. autoattribute:: tile_position -- GitLab