Safe Haskell | None |
---|

All the building blocks to allow rules to manage players.

- getPlayers :: Nomex [PlayerInfo]
- getPlayer :: PlayerNumber -> Nomex (Maybe PlayerInfo)
- getPlayerName :: PlayerNumber -> Nomex (Maybe PlayerName)
- setPlayerName :: PlayerNumber -> PlayerName -> Nomex Bool
- modifyPlayerName :: PlayerNumber -> (PlayerName -> PlayerName) -> Nomex Bool
- getPlayersNumber :: Nomex Int
- getAllPlayerNumbers :: Nomex [PlayerNumber]
- delPlayer :: PlayerNumber -> Nomex Bool
- forEachPlayer :: (PlayerNumber -> Nomex ()) -> (PlayerNumber -> Nomex ()) -> (PlayerNumber -> Nomex ()) -> Nomex ()
- forEachPlayer_ :: (PlayerNumber -> Nomex ()) -> Nomex ()
- createValueForEachPlayer :: forall a. (Typeable a, Show a, Eq a) => a -> MsgVar [(PlayerNumber, a)] -> Nomex ()
- createValueForEachPlayer_ :: MsgVar [(PlayerNumber, Int)] -> Nomex ()
- getValueOfPlayer :: forall a. (Typeable a, Show a, Eq a) => PlayerNumber -> MsgVar [(PlayerNumber, a)] -> Nomex (Maybe a)
- modifyValueOfPlayer :: (Eq a, Show a, Typeable a) => PlayerNumber -> MsgVar [(PlayerNumber, a)] -> (a -> a) -> Nomex ()
- modifyAllValues :: (Eq a, Show a, Typeable a) => MsgVar [(PlayerNumber, a)] -> (a -> a) -> Nomex ()
- showPlayer :: PlayerNumber -> Nomex String
- setVictory :: [PlayerNumber] -> Nomex ()
- giveVictory :: PlayerNumber -> Nomex ()
- getSelfProposedByPlayer :: Nomex PlayerNumber

# Players

getPlayers :: Nomex [PlayerInfo]Source

get all the players

getPlayer :: PlayerNumber -> Nomex (Maybe PlayerInfo)Source

Get a specific player

getPlayerName :: PlayerNumber -> Nomex (Maybe PlayerName)Source

Set the name of a player

setPlayerName :: PlayerNumber -> PlayerName -> Nomex BoolSource

Set the name of a player

modifyPlayerName :: PlayerNumber -> (PlayerName -> PlayerName) -> Nomex BoolSource

getPlayersNumber :: Nomex IntSource

Get the total number of players

getAllPlayerNumbers :: Nomex [PlayerNumber]Source

Get all the players number

delPlayer :: PlayerNumber -> Nomex BoolSource

Remove the player from the game (kick)

forEachPlayer :: (PlayerNumber -> Nomex ()) -> (PlayerNumber -> Nomex ()) -> (PlayerNumber -> Nomex ()) -> Nomex ()Source

perform an action for each current players, new players and leaving players

forEachPlayer_ :: (PlayerNumber -> Nomex ()) -> Nomex ()Source

perform the same action for each players, including new players

createValueForEachPlayer :: forall a. (Typeable a, Show a, Eq a) => a -> MsgVar [(PlayerNumber, a)] -> Nomex ()Source

create a value initialized for each players manages players joining and leaving

createValueForEachPlayer_ :: MsgVar [(PlayerNumber, Int)] -> Nomex ()Source

create a value initialized for each players initialized to zero manages players joining and leaving

getValueOfPlayer :: forall a. (Typeable a, Show a, Eq a) => PlayerNumber -> MsgVar [(PlayerNumber, a)] -> Nomex (Maybe a)Source

modifyValueOfPlayer :: (Eq a, Show a, Typeable a) => PlayerNumber -> MsgVar [(PlayerNumber, a)] -> (a -> a) -> Nomex ()Source

modifyAllValues :: (Eq a, Show a, Typeable a) => MsgVar [(PlayerNumber, a)] -> (a -> a) -> Nomex ()Source

showPlayer :: PlayerNumber -> Nomex StringSource

show a player name based on his number

setVictory :: [PlayerNumber] -> Nomex ()Source

set victory to a list of players

giveVictory :: PlayerNumber -> Nomex ()Source

give victory to one player