Safe Haskell | None |
---|
A set of atomic commands shared by client and server. These are the largest building blocks that have no components that can be observed in isolation.
We try to make atomic commands respect the laws of energy and mass
conservation, unless they really can't, e.g., monster spawning.
For example item removal from inventory is not an atomic command,
but item dropped from the inventory to the ground is. This makes
it easier to undo the commands. In principle, the commands are the only
way to affect the basic game state (State
).
See https://github.com/kosmikus/LambdaHack/wiki/Client-server-architecture.
- data Atomic
- data CmdAtomic
- = CreateActorA ActorId Actor [(ItemId, Item)]
- | DestroyActorA ActorId Actor [(ItemId, Item)]
- | CreateItemA ItemId Item Int Container
- | DestroyItemA ItemId Item Int Container
- | SpotActorA ActorId Actor [(ItemId, Item)]
- | LoseActorA ActorId Actor [(ItemId, Item)]
- | SpotItemA ItemId Item Int Container
- | LoseItemA ItemId Item Int Container
- | MoveActorA ActorId Point Point
- | WaitActorA ActorId Time Time
- | DisplaceActorA ActorId ActorId
- | MoveItemA ItemId Int Container Container
- | AgeActorA ActorId Time
- | HealActorA ActorId Int
- | HasteActorA ActorId Speed
- | PathActorA ActorId (Maybe [Vector]) (Maybe [Vector])
- | ColorActorA ActorId (Maybe Color) (Maybe Color)
- | QuitFactionA FactionId (Maybe Actor) (Maybe Status) (Maybe Status)
- | LeadFactionA FactionId (Maybe ActorId) (Maybe ActorId)
- | DiplFactionA FactionId FactionId Diplomacy Diplomacy
- | AlterTileA LevelId Point (Id TileKind) (Id TileKind)
- | SearchTileA ActorId Point (Id TileKind) (Id TileKind)
- | SpotTileA LevelId [(Point, Id TileKind)]
- | LoseTileA LevelId [(Point, Id TileKind)]
- | AlterSmellA LevelId Point (Maybe Time) (Maybe Time)
- | SpotSmellA LevelId [(Point, Time)]
- | LoseSmellA LevelId [(Point, Time)]
- | AgeLevelA LevelId Time
- | AgeGameA Time
- | DiscoverA LevelId Point ItemId (Id ItemKind)
- | CoverA LevelId Point ItemId (Id ItemKind)
- | PerceptionA LevelId PerActor PerActor
- | RestartA FactionId Discovery FactionPers State Bool Text
- | RestartServerA State
- | ResumeA FactionId FactionPers
- | ResumeServerA State
- | KillExitA FactionId
- | SaveExitA
- | SaveBkpA
- | MsgAllA Msg
- data SfxAtomic
- = StrikeD ActorId ActorId Item HitAtomic
- | RecoilD ActorId ActorId Item HitAtomic
- | ProjectD ActorId ItemId
- | CatchD ActorId ItemId
- | ActivateD ActorId ItemId
- | CheckD ActorId ItemId
- | TriggerD ActorId Point Feature Bool
- | ShunD ActorId Point Feature Bool
- | EffectD ActorId (Effect Int)
- | MsgFidD FactionId Msg
- | MsgAllD Msg
- | DisplayPushD FactionId
- | DisplayDelayD FactionId
- data HitAtomic
- = HitD
- | HitBlockD
- | MissBlockD
- undoCmdAtomic :: CmdAtomic -> Maybe CmdAtomic
- undoSfxAtomic :: SfxAtomic -> SfxAtomic
- undoAtomic :: Atomic -> Maybe Atomic
Documentation
Abstract syntax of atomic commands.
undoAtomic :: Atomic -> Maybe AtomicSource