apecs-0.8.1: Fast Entity-Component-System library for game programming

Safe HaskellNone
LanguageHaskell2010

Apecs.TH

Synopsis

Documentation

makeWorld :: String -> [Name] -> Q [Dec] Source #

makeWorld "WorldName" [''Component1, ''Component2, ...]

turns into

data WorldName = WorldName Component1 Component2 ... EntityCounter
instance WorldName `Has` Component1 where ...
instance WorldName `Has` Component2 where ...
...
instance WorldName `Has` EntityCounter where ...

initWorldName :: IO WorldName
initWorldName = WorldName <$> initStore <*> initStore <*> ... <*> initStore

|

makeWorldNoEC :: String -> [Name] -> Q [Dec] Source #

Same as makeWorld, but has no EntityCounter

makeWorldAndComponents :: String -> [Name] -> Q [Dec] Source #

Same as makeWorld, but also defines Component instances with a Map store.