| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Mischief.ECS.Tables
Synopsis
- newtype Tables = Tables {}
- data Table = Table {
- columns :: IORef (Map ComponentId Column)
- components :: [ComponentId]
- entities :: IOVec (Entity, IORef EntityPointer)
- newtype Column = Column (IOVec ComponentData)
- baseline_entities_cap :: Int
- emptyTables :: IO Tables
- newTable :: [ComponentId] -> IO Table
- tableIsEmpty :: Table -> IO Bool
- tapMap :: (Monad m, Ord k) => Map k a -> k -> (a -> m ()) -> m ()
- insertComponentsIntoMap :: ProcessedBundleData -> Map ComponentId Column -> IO ()
- insertComponentsIntoTable :: ProcessedBundleData -> Table -> IO ()
- replaceComponentsIntoMap :: ProcessedBundleData -> Maybe Tick -> EntityPointer -> Map ComponentId Column -> IO ()
- replaceComponentsIntoTable :: ProcessedBundleData -> Maybe Tick -> EntityPointer -> Table -> IO ()
- takeFromColumn :: EntityPointer -> Column -> IO ComponentData
- takeComponentsFromTable :: EntityPointer -> Table -> IO ProcessedBundleData
- collectComponentIdsFromTable :: Table -> IO [ComponentId]
- removeComponentFromColumn :: EntityPointer -> Column -> IO ()
- removeComponentsFromMap :: EntityPointer -> Map ComponentId Column -> IO ()
- removeComponentsFromTable :: EntityPointer -> Table -> IO ()
- removeRow :: Int -> IOVec (Entity, IORef EntityPointer) -> IO ()
- removeEntityFromTable :: Int -> Table -> IO ()
- insertEntityIntoTables :: ProcessedBundleData -> Tables -> ArchetypeId -> (Entity, IORef EntityPointer) -> IO ()
- tryGetComponentFromColumn :: Component c => Column -> EntityPointer -> IO (Maybe c)
- tryGetRelCollectionFromTable :: Component c => Table -> Entity -> EntityPointer -> ComponentId -> IO (Maybe [Result (Rel c)])
- tryGetComponentFromTable :: Component c => Table -> EntityPointer -> ComponentId -> IO (Maybe c)
- tryGetRelCollectionFromTables :: Component c => Tables -> Entity -> EntityPointer -> ComponentId -> IO (Maybe [Result (Rel c)])
- tryGetComponentFromTables :: Component c => Tables -> EntityPointer -> ComponentId -> IO (Maybe c)
- tryGetTicksFromColumn :: Column -> IO [ComponentTicks]
- tryGetEntityTicksFromColumn :: Column -> EntityPointer -> IO ComponentTicks
- tryGetTicksFromTable :: Table -> ComponentId -> IO [Maybe ComponentTicks]
- tryGetEntityTicksFromTable :: Table -> EntityPointer -> ComponentId -> IO (Maybe ComponentTicks)
- tryGetTicksFromArchetype :: ArchetypeId -> IOVec Table -> ComponentId -> IO [Maybe ComponentTicks]
- tryGetEntityTicksFromArchetype :: ArchetypeId -> IOVec Table -> EntityPointer -> ComponentId -> IO (Maybe ComponentTicks)
- tryGetTicksFromTables :: Tables -> [ArchetypeId] -> ComponentId -> IO [Maybe ComponentTicks]
- tryGetEntityTicksFromTables :: Tables -> EntityPointer -> ComponentId -> IO (Maybe ComponentTicks)
- tryGetComponentsFromColumn :: Component c => Column -> IO [c]
- tryGetRelCollectionsFromTable :: Component c => Table -> ComponentId -> IO [(Entity, [Result (Rel c)])]
- tryGetComponentsFromTable :: Component c => Table -> ComponentId -> IO [(Entity, Result c)]
- tryGetEntitiesFromTable :: Table -> IO [Entity]
- tryGetComponentsFromTableMaybe :: Component c => Table -> ComponentId -> IO [(Entity, Maybe (Result c))]
- tryGetRelCollectionsFromArchetype :: Component c => ArchetypeId -> IOVec Table -> ComponentId -> IO [(Entity, [Result (Rel c)])]
- tryGetComponentsFromArchetype :: Component c => ArchetypeId -> IOVec Table -> ComponentId -> IO [(Entity, Result c)]
- tryGetEntitiesFromArchetype :: ArchetypeId -> IOVec Table -> IO [Entity]
- tryGetComponentsFromArchetypeMaybe :: Component c => ArchetypeId -> IOVec Table -> ComponentId -> IO [(Entity, Maybe (Result c))]
- tryGetRelCollectionsFromTables :: Component c => Tables -> [ArchetypeId] -> ComponentId -> IO [(Entity, [Result (Rel c)])]
- tryGetComponentsFromTables :: Component c => Tables -> [ArchetypeId] -> ComponentId -> IO [(Entity, Result c)]
- tryGetEntitiesFromTables :: Tables -> [ArchetypeId] -> IO [Entity]
- tryGetComponentsFromTablesMaybe :: Component c => Tables -> [ArchetypeId] -> ComponentId -> IO [(Entity, Maybe (Result c))]
- newtype Result c = Result (c, Entity)
- data ErasedResult where
- ErasedResult :: forall c. Result c -> ErasedResult
- value :: Result c -> c
- type family IsComp a :: Bool where ...
- entityOf :: Result c -> Entity
- class DeepValue' (flag :: k) c i | flag c -> i where
- deepValue' :: c -> i
- class DeepValue c i | c -> i where
- deepValue :: c -> i
Documentation
Constructors
| Table | |
Fields
| |
emptyTables :: IO Tables Source #
tapMap :: (Monad m, Ord k) => Map k a -> k -> (a -> m ()) -> m () Source #
runs the specified monadic action with the value of the given map key as input, if the key exists. if it doesn't, do nothing
insertComponentsIntoMap :: ProcessedBundleData -> Map ComponentId Column -> IO () Source #
insertComponentsIntoTable :: ProcessedBundleData -> Table -> IO () Source #
replaceComponentsIntoMap Source #
Arguments
| :: ProcessedBundleData | |
| -> Maybe Tick | The current tick that will be as the components' change tick. |
| -> EntityPointer | |
| -> Map ComponentId Column | |
| -> IO () |
replaceComponentsIntoTable Source #
Arguments
| :: ProcessedBundleData | |
| -> Maybe Tick | The current tick that will be as the components' change tick. |
| -> EntityPointer | |
| -> Table | |
| -> IO () |
takeFromColumn :: EntityPointer -> Column -> IO ComponentData Source #
removeComponentFromColumn :: EntityPointer -> Column -> IO () Source #
removeComponentsFromMap :: EntityPointer -> Map ComponentId Column -> IO () Source #
removeComponentsFromTable :: EntityPointer -> Table -> IO () Source #
insertEntityIntoTables :: ProcessedBundleData -> Tables -> ArchetypeId -> (Entity, IORef EntityPointer) -> IO () Source #
tryGetComponentFromColumn :: Component c => Column -> EntityPointer -> IO (Maybe c) Source #
tryGetRelCollectionFromTable :: Component c => Table -> Entity -> EntityPointer -> ComponentId -> IO (Maybe [Result (Rel c)]) Source #
tryGetComponentFromTable :: Component c => Table -> EntityPointer -> ComponentId -> IO (Maybe c) Source #
tryGetRelCollectionFromTables :: Component c => Tables -> Entity -> EntityPointer -> ComponentId -> IO (Maybe [Result (Rel c)]) Source #
tryGetComponentFromTables :: Component c => Tables -> EntityPointer -> ComponentId -> IO (Maybe c) Source #
tryGetTicksFromColumn :: Column -> IO [ComponentTicks] Source #
tryGetTicksFromTable :: Table -> ComponentId -> IO [Maybe ComponentTicks] Source #
tryGetEntityTicksFromTable :: Table -> EntityPointer -> ComponentId -> IO (Maybe ComponentTicks) Source #
tryGetTicksFromArchetype :: ArchetypeId -> IOVec Table -> ComponentId -> IO [Maybe ComponentTicks] Source #
tryGetEntityTicksFromArchetype :: ArchetypeId -> IOVec Table -> EntityPointer -> ComponentId -> IO (Maybe ComponentTicks) Source #
tryGetTicksFromTables :: Tables -> [ArchetypeId] -> ComponentId -> IO [Maybe ComponentTicks] Source #
tryGetEntityTicksFromTables :: Tables -> EntityPointer -> ComponentId -> IO (Maybe ComponentTicks) Source #
tryGetRelCollectionsFromTable :: Component c => Table -> ComponentId -> IO [(Entity, [Result (Rel c)])] Source #
tryGetComponentsFromTable :: Component c => Table -> ComponentId -> IO [(Entity, Result c)] Source #
tryGetComponentsFromTableMaybe :: Component c => Table -> ComponentId -> IO [(Entity, Maybe (Result c))] Source #
tryGetRelCollectionsFromArchetype :: Component c => ArchetypeId -> IOVec Table -> ComponentId -> IO [(Entity, [Result (Rel c)])] Source #
tryGetComponentsFromArchetype :: Component c => ArchetypeId -> IOVec Table -> ComponentId -> IO [(Entity, Result c)] Source #
tryGetEntitiesFromArchetype :: ArchetypeId -> IOVec Table -> IO [Entity] Source #
tryGetComponentsFromArchetypeMaybe :: Component c => ArchetypeId -> IOVec Table -> ComponentId -> IO [(Entity, Maybe (Result c))] Source #
tryGetRelCollectionsFromTables :: Component c => Tables -> [ArchetypeId] -> ComponentId -> IO [(Entity, [Result (Rel c)])] Source #
tryGetComponentsFromTables :: Component c => Tables -> [ArchetypeId] -> ComponentId -> IO [(Entity, Result c)] Source #
tryGetEntitiesFromTables :: Tables -> [ArchetypeId] -> IO [Entity] Source #
tryGetComponentsFromTablesMaybe :: Component c => Tables -> [ArchetypeId] -> ComponentId -> IO [(Entity, Maybe (Result c))] Source #
Instances
data ErasedResult where Source #
Constructors
| ErasedResult :: forall c. Result c -> ErasedResult |
class DeepValue' (flag :: k) c i | flag c -> i where Source #
Methods
deepValue' :: c -> i Source #
Instances
| DeepValue' 'False (Result (Rel c)) c Source # | |
Defined in Mischief.ECS.Tables Methods deepValue' :: Result (Rel c) -> c Source # | |
| DeepValue' 'True (Result c) c Source # | |
Defined in Mischief.ECS.Tables Methods deepValue' :: Result c -> c Source # | |