-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
308 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
from typing import Optional | ||
from app.dto import Investigator | ||
|
||
|
||
class Player: | ||
def __init__(self, id: str, nickname: str): | ||
self._id = id | ||
self._nickname = nickname | ||
self._investigator = None | ||
self._nickname: str = nickname | ||
self._investigator: Optional[Investigator] = None | ||
self._rdy_start: bool = False | ||
|
||
def set_investigator(self, investigator): | ||
self._investigator = investigator | ||
def set_investigator(self, value: Investigator): | ||
self._investigator = value | ||
|
||
def get_investigator(self): | ||
def get_investigator(self) -> Optional[Investigator]: | ||
return self._investigator | ||
|
||
@property | ||
def id(self): | ||
return self._id | ||
|
||
@property | ||
def started(self) -> bool: | ||
return self._rdy_start | ||
|
||
def start(self): | ||
self._rdy_start = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# automatically generated by the FlatBuffers compiler, do not modify | ||
|
||
# namespace: | ||
|
||
import flatbuffers | ||
from flatbuffers.compat import import_numpy | ||
|
||
np = import_numpy() | ||
|
||
|
||
class GameStart(object): | ||
__slots__ = ["_tab"] | ||
|
||
@classmethod | ||
def GetRootAs(cls, buf, offset=0): | ||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) | ||
x = GameStart() | ||
x.Init(buf, n + offset) | ||
return x | ||
|
||
@classmethod | ||
def GetRootAsGameStart(cls, buf, offset=0): | ||
"""This method is deprecated. Please switch to GetRootAs.""" | ||
return cls.GetRootAs(buf, offset) | ||
|
||
# GameStart | ||
def Init(self, buf, pos): | ||
self._tab = flatbuffers.table.Table(buf, pos) | ||
|
||
# GameStart | ||
def GameId(self): | ||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) | ||
if o != 0: | ||
return self._tab.String(o + self._tab.Pos) | ||
return None | ||
|
||
# GameStart | ||
def PlayerId(self): | ||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) | ||
if o != 0: | ||
return self._tab.String(o + self._tab.Pos) | ||
return None | ||
|
||
|
||
def GameStartStart(builder): | ||
builder.StartObject(2) | ||
|
||
|
||
def Start(builder): | ||
GameStartStart(builder) | ||
|
||
|
||
def GameStartAddGameId(builder, gameId): | ||
builder.PrependUOffsetTRelativeSlot( | ||
0, flatbuffers.number_types.UOffsetTFlags.py_type(gameId), 0 | ||
) | ||
|
||
|
||
def AddGameId(builder, gameId): | ||
GameStartAddGameId(builder, gameId) | ||
|
||
|
||
def GameStartAddPlayerId(builder, playerId): | ||
builder.PrependUOffsetTRelativeSlot( | ||
1, flatbuffers.number_types.UOffsetTFlags.py_type(playerId), 0 | ||
) | ||
|
||
|
||
def AddPlayerId(builder, playerId): | ||
GameStartAddPlayerId(builder, playerId) | ||
|
||
|
||
def GameStartEnd(builder): | ||
return builder.EndObject() | ||
|
||
|
||
def End(builder): | ||
return GameStartEnd(builder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.