SimplePlayers¶
Role: Factory that produces a matched
(SimplePlayerA, SimplePlayerB)pair sharing aGameLayout. Location:Q_Sea_Battle.simple_players.SimplePlayers
Constructor¶
| Parameter | Type | Description |
|---|---|---|
| game_layout | GameLayout | None, constraint: may be None |
Optional shared configuration; if None, a default GameLayout is created by the base class. |
Preconditions
- Not specified.
Postconditions
self.game_layoutis initialized via the basePlayersconstructor (exact initialization behavior is defined byPlayers).
Errors
- Not specified.
Example
from Q_Sea_Battle.simple_players import SimplePlayers
factory = SimplePlayers()
player_a, player_b = factory.players()
Public Methods¶
players¶
Create a (SimplePlayerA, SimplePlayerB) pair that shares the same GameLayout.
Returns
Tuple[PlayerA, PlayerB], constraint: length exactly2, shape:(2,)as a fixed-size 2-tuple of(player_a, player_b).
Preconditions
- Not specified.
Postconditions
- Returns two newly created player objects, both constructed with
self.game_layout.
Errors
- Not specified.
Example
factory = SimplePlayers()
player_a, player_b = factory.players()
Data & State¶
game_layout:GameLayout, constraints: not specified in this module; provided/managed by the base classPlayers.
Planned (design-spec)¶
- None specified.
Deviations¶
- None identified (no design notes provided beyond empty placeholder).
Notes for Contributors¶
- This class delegates
GameLayoutinitialization toPlayers.__init__; changes to default layout behavior should be implemented inPlayers, not here. - The concrete player types are hard-coded as
SimplePlayerAandSimplePlayerBwithinplayers().
Related¶
Q_Sea_Battle.players_base.PlayersQ_Sea_Battle.players_base.PlayerAQ_Sea_Battle.players_base.PlayerBQ_Sea_Battle.game_layout.GameLayoutQ_Sea_Battle.simple_player_a.SimplePlayerAQ_Sea_Battle.simple_player_b.SimplePlayerB
Changelog¶
- 0.1: Initial version (module docstring).