-
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.
Add Board class; switch to single turn object
- Loading branch information
1 parent
4811433
commit 127b955
Showing
21 changed files
with
257 additions
and
192 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
players: | ||
- code: '1234' | ||
color: red | ||
turns: | ||
- done: false | ||
turn: | ||
done: false | ||
moves: [] | ||
- code: '5678' | ||
color: blue | ||
turns: | ||
- done: false | ||
turn: | ||
done: false | ||
moves: [] | ||
turn: 1 |
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,6 +1,7 @@ | ||
"""Domain models for the application.""" | ||
|
||
from .move import Move, Moves | ||
from .turn import Turn, Turns | ||
from .turn import Turn | ||
from .player import Player, Players | ||
from .board import Board | ||
from .game import Game |
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,26 @@ | ||
"""Classes representing boards.""" | ||
|
||
import copy | ||
|
||
from .. import common | ||
|
||
|
||
log = common.logger(__name__) | ||
|
||
|
||
class Board: | ||
|
||
"""The board for a game.""" | ||
|
||
@classmethod | ||
def randomize(cls, players): | ||
"""Create a new random board for the players.""" | ||
# TODO: implement randomize | ||
print(players) | ||
return cls() | ||
|
||
def update(self, players): | ||
"""Update the board state from the player's moves.""" | ||
# TODO: implement update | ||
print(players) | ||
return copy.copy(self) |
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
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.