Skip to content

Commit

Permalink
docs: doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bgeninatti committed May 28, 2021
1 parent 5af37c0 commit ae689fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
4 changes: 2 additions & 2 deletions docs/source/tutorial/01_first_player.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ at the beginning of turn 0, and it will make decisions based on that information
the game at turn 1. This sequence will be repeated again and again in an iterative process until the
game finishes.

Your player then is not more than a [python class](https://docs.python.org/3/tutorial/classes.html) implementing a
[method](https://docs.python.org/3/tutorial/classes.html#method-objects) that is executed every turn.
Your player then is not more than a `python class <https://docs.python.org/3/tutorial/classes.html>`_ implementing a
`method <https://docs.python.org/3/tutorial/classes.html#method-objects>`_ that is executed every turn.
This method receives as parameters the state of the ``galaxy``, and some other ``context`` about the state of the game
(i.e, the scoreboard and other useful data), and it must return the same ``galaxy`` instance with some changes reflecting
the player's decisions.
Expand Down
21 changes: 3 additions & 18 deletions pythonium/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def next_turn(self, galaxy: Galaxy, context: dict) -> Galaxy:
:param galaxy: The state of the Galaxy known by the player.
:param context: Aditional information about the game.
``galaxy`` and ``context`` are defined by the game mode. For now, Pythonium \
includes only one game mode: the **Classic Mode**.
In this game, mode the players can see the following
Players can see the following
On one hand, each player sees a different part of the galaxy, and the ``galaxy`` \
known by a player contains:
Expand All @@ -37,28 +35,15 @@ def next_turn(self, galaxy: Galaxy, context: dict) -> Galaxy:
The player won't know the attributes of enemy ships or planets but the position.
On the other hand the Classic Mode's ``context`` has the following keys:
``context`` has the following keys:
* ``ship_types``: A dictionary with all the ship types that the player can \
build. See: :class:`ShipType`
* ``tolerable_taxes``: The level of taxes from where ``happypoints`` start \
to decay.
* ``happypoints_tolerance``: The level of happypoints from where \
``rioting_index`` affects the planet's economy.
* ``score``: A list with the score for each player.
* ``turn``: Number of the current turn. There is one dictionary for each \
player. Each dictionary has the following structure:
.. code-block:: json
{
'turn': str # Turn number,
'player': str # Player's name,
'planets': int # Amount of planets that the player owns,
'ship_<ship_type>': int, # Amount of <ship_type> own by player,
'total_ships': int # Total amount of ships that the player owns.
}
* ``turn``: Number of the current turn.
"""
raise NotImplementedError(
"You must implement the ``next_turn`` method in your ``Player`` class"
Expand Down

0 comments on commit ae689fa

Please sign in to comment.