Safe Haskell | None |
---|---|
Language | Haskell98 |
Entity of the Entity ComponentType System for Fresco Haskell Binding
- (#:) :: ComponentClass a => ComponentType a -> a -> (Word64, Component)
- data Entity = Entity (Ptr ())
- newE :: [(Word64, Component)] -> IO Entity
- readC :: ComponentClass a => Entity -> ComponentType a -> IO a
- updateC :: ComponentClass a => Entity -> ComponentType a -> (a -> a) -> IO ()
- setC :: ComponentClass a => Entity -> ComponentType a -> a -> IO ()
- data CallbackSystem = CallbackSystem (Ptr ())
- createCBS :: IO CallbackSystem
- stepCBS :: CallbackSystem -> IO ()
- registerReceiverCBS :: ComponentClass a => CallbackSystem -> Entity -> ComponentType a -> (a -> IO ()) -> IO ()
EntityData Type
(#:) :: ComponentClass a => ComponentType a -> a -> (Word64, Component) Source
pair builder for nice construction syntax, allows [ ct #: val, ...] syntax
Entity Type
ERef, composable objects, referenced Entities with listeners
readC :: ComponentClass a => Entity -> ComponentType a -> IO a Source
reads one ComponentType, throws exception, if ComponentType not present, or wrong type
updateC :: ComponentClass a => Entity -> ComponentType a -> (a -> a) -> IO () Source
updates one ComponentType
setC :: ComponentClass a => Entity -> ComponentType a -> a -> IO () Source
sets one ComponentType
data CallbackSystem Source
CallbackSystem (Ptr ()) |
stepCBS :: CallbackSystem -> IO () Source
registerReceiverCBS :: ComponentClass a => CallbackSystem -> Entity -> ComponentType a -> (a -> IO ()) -> IO () Source