| Copyright | (c) Alexander Vieth, 2015 |
|---|---|
| License | BSD3 |
| Maintainer | aovieth@gmail.com |
| Stability | experimental |
| Portability | non-portable (GHC only) |
| Safe Haskell | None |
| Language | Haskell2010 |
Diplomacy.Game
Description
- data Game round roundStatus where
- TypicalGame :: TypicalRound round -> Status roundStatus -> Turn -> Map Zone (Aligned Unit, RoundOrderConstructor roundStatus Typical) -> Control -> Game round roundStatus
- RetreatGame :: RetreatRound round -> Status roundStatus -> Turn -> Resolution Typical -> Map Zone (Aligned Unit, RoundOrderConstructor roundStatus Retreat) -> Occupation -> Control -> Game round roundStatus
- AdjustGame :: AdjustRound round -> Status roundStatus -> Turn -> Map Zone (Aligned Unit, RoundOrderConstructor roundStatus Adjust) -> Control -> Game round roundStatus
- data Round where
- data RoundStatus where
- data Status roundStatus where
- data TypicalRound round where
- data RetreatRound round where
- data AdjustRound round where
- type family NextRound round :: Round
- type family RoundPhase round :: Phase
- type family RoundOrderConstructor roundStatus :: Phase -> *
- roundToInt :: Round -> Int
- nextRound :: Round -> Round
- prevRound :: Round -> Round
- gameZonedOrders :: Game round RoundUnresolved -> Map Zone (Aligned Unit, SomeOrderObject (RoundPhase round))
- gameZonedResolvedOrders :: Game round RoundResolved -> Map Zone (Aligned Unit, SomeResolved OrderObject (RoundPhase round))
- gameOccupation :: Game round roundStatus -> Occupation
- gameDislodged :: (RoundPhase round ~ Retreat) => Game round RoundUnresolved -> Map Zone (Aligned Unit)
- gameControl :: Game round roundStatus -> Control
- gameTurn :: Game round roundStatus -> Turn
- gameRound :: Game round roundStatus -> Round
- gameSeason :: Game round roundStatus -> Season
- issueOrders :: forall round. Map Zone (Aligned Unit, SomeOrderObject (RoundPhase round)) -> Game round RoundUnresolved -> (ValidateOrdersOutput (RoundPhase round), Game round RoundUnresolved)
- resolve :: Game round RoundUnresolved -> Game round RoundResolved
- continue :: Game round RoundResolved -> Game (NextRound round) RoundUnresolved
- newGame :: Game RoundOne RoundUnresolved
- showGame :: Game round roundStatus -> String
Documentation
data Game round roundStatus where Source
Constructors
| TypicalGame :: TypicalRound round -> Status roundStatus -> Turn -> Map Zone (Aligned Unit, RoundOrderConstructor roundStatus Typical) -> Control -> Game round roundStatus | |
| RetreatGame :: RetreatRound round -> Status roundStatus -> Turn -> Resolution Typical -> Map Zone (Aligned Unit, RoundOrderConstructor roundStatus Retreat) -> Occupation -> Control -> Game round roundStatus | |
| AdjustGame :: AdjustRound round -> Status roundStatus -> Turn -> Map Zone (Aligned Unit, RoundOrderConstructor roundStatus Adjust) -> Control -> Game round roundStatus |
Instances
| Typeable (Round -> RoundStatus -> *) Game |
data RoundStatus where Source
Constructors
| RoundUnresolved :: RoundStatus | |
| RoundResolved :: RoundStatus |
Instances
data Status roundStatus where Source
Constructors
| Unresolved :: Status RoundUnresolved | |
| Resolved :: Status RoundResolved |
Instances
| Typeable (RoundStatus -> *) Status |
data TypicalRound round where Source
Constructors
| TypicalRoundOne :: TypicalRound RoundOne | |
| TypicalRoundTwo :: TypicalRound RoundThree |
Instances
| Show (TypicalRound round) |
data RetreatRound round where Source
Constructors
| RetreatRoundOne :: RetreatRound RoundTwo | |
| RetreatRoundTwo :: RetreatRound RoundFour |
Instances
| Show (RetreatRound round) |
data AdjustRound round where Source
Constructors
| AdjustRound :: AdjustRound RoundFive |
Instances
| Show (AdjustRound round) |
type family RoundPhase round :: Phase Source
Equations
| RoundPhase RoundOne = Typical | |
| RoundPhase RoundTwo = Retreat | |
| RoundPhase RoundThree = Typical | |
| RoundPhase RoundFour = Retreat | |
| RoundPhase RoundFive = Adjust |
type family RoundOrderConstructor roundStatus :: Phase -> * Source
roundToInt :: Round -> Int Source
gameZonedOrders :: Game round RoundUnresolved -> Map Zone (Aligned Unit, SomeOrderObject (RoundPhase round)) Source
gameZonedResolvedOrders :: Game round RoundResolved -> Map Zone (Aligned Unit, SomeResolved OrderObject (RoundPhase round)) Source
gameOccupation :: Game round roundStatus -> Occupation Source
gameDislodged :: (RoundPhase round ~ Retreat) => Game round RoundUnresolved -> Map Zone (Aligned Unit) Source
gameControl :: Game round roundStatus -> Control Source
gameSeason :: Game round roundStatus -> Season Source
issueOrders :: forall round. Map Zone (Aligned Unit, SomeOrderObject (RoundPhase round)) -> Game round RoundUnresolved -> (ValidateOrdersOutput (RoundPhase round), Game round RoundUnresolved) Source
The game given as the second component of the return value will differ from the input game only if all orders are valid. NB for adjust phase we wipe all build orders; that's because there's no way to explicitly remove a build order by overwriting it with some other order.
resolve :: Game round RoundUnresolved -> Game round RoundResolved Source
continue :: Game round RoundResolved -> Game (NextRound round) RoundUnresolved Source