Nomyx-Language-0.6.2: 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 InputForm a whereSource

Input forms

Constructors

Text :: InputForm String 
TextArea :: InputForm String 
Button :: InputForm () 
Radio :: (Show a, Eq a) => [(a, String)] -> InputForm a 
Checkbox :: (Show a, Eq a) => [(a, String)] -> InputForm [a] 

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, String)] -> Event cSource

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