From 228d0f66214b3e8499bc4c5d71fbd97a5ff733a1 Mon Sep 17 00:00:00 2001 From: Falcon Date: Mon, 13 Nov 2023 09:33:10 +0000 Subject: [PATCH] docs: auto update index.rst --- docs/index.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 6208623..d0f8e26 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -126,14 +126,16 @@ Getting Started If you want to start with the Software-Challenge Python Client, you have to import some dependencies first. -The import is kept very simple, since herewith all needed dependencies -are imported, due to changes of the ``__init__.py``. But if you want to -avoid unnecessary imports, you can of course import only what you -actually need. +The following are all possible imports which are available. You won't +need every, but for the sake of completeness all are listed. .. code:: python - from socha import * + from socha import Accelerate, AccelerationProblem, Advance, AdvanceInfo, AdvanceProblem, Board + from socha import CartesianCoordinate, CubeCoordinates, CubeDirection, Field, FieldType, GameState + from socha import Move, Passenger, Push, PushProblem, Segment, Ship, TeamEnum, TeamPoints, Turn, TurnProblem + from socha.api.networking.game_client import IClientHandler + from socha.starter import Starter If you now want to develop and implement your logic, then the structure of the class should look like this. @@ -144,8 +146,7 @@ of the class should look like this. gameState: GameState def calculate_move(self) -> Move: - possibleMoves = self.gameState.possible_moves - return possibleMoves[0] + return Move([Advance(1)]) def on_update(self, state: GameState): self.gameState = state @@ -164,6 +165,12 @@ arguments. if __name__ == "__main__": Starter(Logic()) +.. + + If you want a complete file as an example, you can take a look at + this + ```logic.py`` `__. + Start arguments ~~~~~~~~~~~~~~~ @@ -314,7 +321,7 @@ can use a logic written in Python and make changes in the Rust code. Each time a change is made, ``maturin develop`` must be executed again to make the change visible to the Python code. -.. |Read the Docs| image:: https://img.shields.io/readthedocs/socha-python-client.readthedocs?label=Docs +.. |Read the Docs| image:: https://img.shields.io/readthedocs/socha-python-client?label=Docs :target: https://socha-python-client.readthedocs.io/en/latest/ .. |PyPI| image:: https://img.shields.io/pypi/v/socha?label=PyPi :target: https://pypi.org/project/socha/