Got the starter snake going

This commit is contained in:
2023-09-09 11:34:46 -05:00
parent 6de4111b05
commit 3654aebb5e
6 changed files with 24 additions and 7 deletions

View File

@@ -4,9 +4,10 @@ import typing
class Snake:
SNAKES: typing.Dict[str, typing.Type["Snake"]] = {}
name = "snake"
def __init_subclass__(cls) -> None:
cls.SNAKES[cls.__name__] = cls
cls.SNAKES[cls.name] = cls
def info(self) -> typing.Dict:
'''info is called when you create your Battlesnake on play.battlesnake.com

View File

@@ -8,6 +8,8 @@ from .snake import Snake
class StarterSnake(Snake):
'''Snake from Battlesnake's starter snake repo'''
name = "starter_snake"
def info(self) -> typing.Dict:
print("INFO")