License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.Game.Scenario.Topography.Structure.Recognition.Tracking
Description
Online operations for structure recognizer.
See Swarm.Game.Scenario.Topography.Structure.Recognition.Precompute for details of the structure recognition process.
Synopsis
- data RecognitionActiveStatus
- entityModified :: (Monad s, Hashable a, Eq b) => GenericEntLocator s a -> CellModification a -> Cosmic Location -> RecognizerAutomatons b a -> RecognitionState b a -> s (RecognitionState b a)
- entityModifiedLoggable :: (Monoid (f (SearchLog a)), Monad m, Hashable a, Eq b, Applicative f) => RecognitionActiveStatus -> (Cosmic Location -> m (AtomicKeySymbol a)) -> CellModification a -> Cosmic Location -> RecognizerAutomatons b a -> RecognitionState b a -> WriterT (f (SearchLog a)) m (RecognitionState b a)
Documentation
data RecognitionActiveStatus Source #
Constructors
RecognizeNewStructures | |
DisableNewRecognition | Do not add new recognitions to the registry. This is useful if one needs to construct a larger structure for which other smaller structures contained within it would otherwise be recognized first, precluding the larger structure from ever being recognized. Removing elements of a previously recognized structure will still cause it to be removed from the registry. |
Instances
entityModified :: (Monad s, Hashable a, Eq b) => GenericEntLocator s a -> CellModification a -> Cosmic Location -> RecognizerAutomatons b a -> RecognitionState b a -> s (RecognitionState b a) Source #
A hook called from the centralized entity update function,
updateEntityAt
.
entityModifiedLoggable :: (Monoid (f (SearchLog a)), Monad m, Hashable a, Eq b, Applicative f) => RecognitionActiveStatus -> (Cosmic Location -> m (AtomicKeySymbol a)) -> CellModification a -> Cosmic Location -> RecognizerAutomatons b a -> RecognitionState b a -> WriterT (f (SearchLog a)) m (RecognitionState b a) Source #
This handles structure detection upon addition of an entity, and structure de-registration upon removal of an entity. Also handles atomic entity swaps.