Hangkell-1.0.0: Like Hangman but online!

Copyright>implying
License>implying
MaintainerFlorian Hageneder
Stabilitynone
Portabilitywhat?
Safe HaskellNone
LanguageHaskell2010

Player

Description

 

Synopsis

Documentation

maxFaliures :: Int Source #

The maximum amount of failures a player is allowed to do before he has to die

data Player Source #

Data type to bundle Imformation about a player within an game session.

Constructors

Player 

Fields

Instances

newPlayer Source #

Arguments

:: Int

the id for the player

-> Player

created player

Creates a new Player with the given id. The player is initialized with NO secret and alive

newPlayer 4 >>> (4, "", 0, True)

playersAlive Source #

Arguments

:: [Player]

A set of players

-> [Player]

All players currently allowed to play

returns a list of all players alive

wrongGuess Source #

Arguments

:: Player

player that guessed wrong

-> Player

updated player

Updates the player after an wrong try. Kills him after last failure

getPlayerForId Source #

Arguments

:: [Player]

The set of players to search in

-> Int

The id of the player to fetch

-> String

The secret key of the player

-> Maybe Player

A player or Nothing if id or key did not match

Grants access to a player with given id if the key does match

killPlayer Source #

Arguments

:: Player

currently player who did a terrible mistake

-> Player

Now dead player

Sets the state of an player to dead