example in doc: from socha import * not sufficient
Closed this issue · 1 comments
kwollw commented
Description
Using the example from "Getting started" IClientHandler and Starter will not be resolved.
Environment
- Python version: 3.11.2
- Operating System: Debian 12
- Version of the Python SoCha Client: 2.0.2
Expected Behavior
Getting Starting example running out of the box
Actual Behavior
NameError: name 'IClientHandler' is not defined
after adding from socha.api.networking.game_client import IClientHandler :
NameError: name 'Starter' is not defined
Additional Context
The example should be replaced by this file:
from socha.api.networking.game_client import IClientHandler
from socha.starter import Starter
from socha import *
class Logic(IClientHandler):
gameState: GameState
def calculate_move(self) -> Move:
m = Move(actions = [Advance(1)])
return m
def on_update(self, state: GameState):
self.gameState = state
if __name__ == "__main__":
Starter(Logic())
maxblan commented
The README has not been updated in this respect. I will fix this. For now, please use this file as a reference:
https://github.com/maxblan/socha-python-client/blob/master/logic.py