Nomyx-Language-0.5.0: Language to express rules for Nomic

Safe HaskellNone

Language.Nomyx.Engine

Contents

Description

Warning: Nomyx internals (not required to compose rules and play the game) This module implements game engine. the module manages the effects of rules over each others. This module is not required

Synopsis

Game management

data LoggedGame Source

A game being non serializable, we have to store events in parralel in order to rebuild the state latter.

Constructors

LoggedGame 

Fields

_game :: Game
 
_gameLog :: [TimedEvent]
 

data Game Source

The state of the game:

Instances

Eq Game 
Ord Game 
Show Game

Show instance for Game showing a game involves evaluating some parts (such as victory and outputs)

Typeable Game 

execWithGame :: UTCTime -> State LoggedGame () -> LoggedGame -> LoggedGameSource

A helper function to use the state transformer GameState. It additionally sets the current time.

Variables management

data Var Source

stores the variable's data

Constructors

forall a . (Typeable a, Show a) => Var 

Instances

Rules management

Events management

data Status Source

Constructors

SActive 
SDeleted 

Instances

Inputs management

Outputs management

data Log Source

Constructors

Log 

Instances

Time

Misc

tracePN :: Monad m => Int -> String -> m ()Source

replaceWithSource

Arguments

:: (a -> Bool)

Value to search

-> a

Value to replace it with

-> [a]

Input list

-> [a]

Output list

Replaces all instances of a value in a list by another value.