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

Safe HaskellNone

Language.Nomyx.Inputs

Contents

Description

All the building blocks to allow rules to get inputs.

Synopsis

Inputs

Radio inputs

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

inputRadioEnum :: forall c. (Enum c, Bounded c, Typeable c, Eq c, Show c) => PlayerNumber -> String -> c -> Event (Input c)Source

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 ()Source

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

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

the same, disregard the event number

onInputRadioEnum :: forall a. (Enum a, Bounded a, Typeable a, Eq a, Show a) => String -> a -> (EventNumber -> a -> Nomex ()) -> PlayerNumber -> Nomex EventNumberSource

triggers a choice input to the user, using an enumerate as input

onInputRadioEnum_ :: forall a. (Enum a, Bounded a, Typeable a, Eq a, Show a) => String -> a -> (a -> Nomex ()) -> PlayerNumber -> Nomex ()Source

the same, disregard the event number

onInputRadioEnumOnce_ :: forall a. (Enum a, Bounded a, Typeable a, Eq a, Show a) => String -> a -> (a -> Nomex ()) -> PlayerNumber -> Nomex ()Source

the same, suppress the event after first trigger

Text inputs

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 ()Source

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.

Checkbox inputs

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

onInputCheckboxOnce :: (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 ()Source

Button inputs

Textarea inputs