Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
makeWorld :: String -> [Name] -> Q [Dec] Source #
The typical way to create a world
record, associated Has
instances, and initialization function.
makeWorld "MyWorld" [''Component1, ''Component2, ...]
turns into
data MyWorld = MyWorld Component1 Component2 ... EntityCounter instance MyWorld `Has` Component1 where ... instance MyWorld `Has` Component2 where ... ... instance MyWorld `Has` EntityCounter where ... initMyWorld :: IO MyWorld initMyWorld = MyWorld <$> initStore <*> initStore <*> ... <*> initStore
makeWorldNoEC :: String -> [Name] -> Q [Dec] Source #
Same as makeWorld
, but does not include an EntityCounter
You don't typically want to use this, but it's exposed in case you know what you're doing.