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

Safe HaskellNone

Language.Nomyx.Inputs

Description

All the building blocks to allow rules to get inputs. for example, you can create a button that will display a message like this: do void $ onInputButton_ Click here: (const $ outputAll_ Bravo!) 1

Synopsis

Documentation

data Input a Source

Instances

Typeable1 Input 
Eq e => Eq (Input e) 
Show a => Show (Input a) 

data InputForm a Source

Constructors

Radio [(a, String)] 
Text 
TextArea 
Button 
Checkbox [(a, String)] 

Instances

onInputRadio :: (Typeable a, Eq a, Show a) => String -> [a] -> (EventNumber -> a -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

triggers a choice input to the user. The result will be sent to the callback

onInputRadio_ :: (Typeable a, Eq a, Show a) => String -> [a] -> (a -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

the same, disregard the event number

onInputRadioOnce :: (Typeable a, Eq a, Show a) => String -> [a] -> (a -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

the same, suppress the event after first trigger

onInputText :: String -> (EventNumber -> String -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

triggers a string input to the user. The result will be sent to the callback

onInputText_ :: String -> (String -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

asks the player pn to answer a question, and feed the callback with this data.

onInputTextOnce :: String -> (String -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

asks the player pn to answer a question, and feed the callback with this data.

onInputCheckbox_ :: (Typeable a, Eq a, Show a) => String -> [(a, String)] -> ([a] -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

onInputCheckboxOnce :: (Typeable a, Eq a, Show a) => String -> [(a, String)] -> ([a] -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

inputRadio :: (Eq c, Show c, Typeable c) => PlayerNumber -> String -> [c] -> c -> Event (Input c)Source