pulsar/src/Overseer.hs

18 lines
1.4 KiB
Haskell

--{-# LANGUAGE TypeFamilyDependencies #-}
module Overseer(
) where
import Lib
import Data.Sequence
{-| The Overseer module handles disseminating and redirecting events between the relavent parties. Overall, this means that the Overseer for a type will have the full list of all UIDs in that type. For types with sub-types (such as the Creature -> BodyPart -> Sense relation), the Overseer carries the highest parent type.
-- An efficient data structure for searching is required, as there will be many searches per tick. A BST is ideal, however this requires restructuring the UID type to be indicative of position (i.e. it should not be monotonically increasing unless the tree is self-balancing)
-- Signalling success/failure back is important. Obviously, a bunch of events can be queued, however, there are race conditions. E.g. if two creatures attempt to pick up the same item in the same tick. In this case, we should use some deterministic mechanism to solve who gets priority. The other creature should be informed that they failed.
-- In this system, a list of Actions will be compiled at each tick, and the GameState will fold over them for each Overseer, applying each to its relevant member.
|-}
---- GameState and Action Definitions -----------------------------------------------------------------------------------------------------
-- TODO: Figure out how to structure actions and event queues
-- This will likely require some kind of type-level list