{-# LANGUAGE TemplateHaskell #-}

-- |
-- SPDX-License-Identifier: BSD-3-Clause
--
-- Public interface for structure recognizer.
--
-- Note that we only support "recognition" of structures defined at the
-- scenario-global level.
module Swarm.Game.Scenario.Topography.Structure.Recognition where

import Control.Lens
import GHC.Generics (Generic)
import Swarm.Game.Scenario.Topography.Structure.Recognition.Log
import Swarm.Game.Scenario.Topography.Structure.Recognition.Registry

-- |
-- The type parameters, `b`, and `a`, correspond
-- to 'Cell' and 'Entity', respectively.
data RecognitionState b a = RecognitionState
  { forall b a. RecognitionState b a -> FoundRegistry b a
_foundStructures :: FoundRegistry b a
  -- ^ Records the top-left corner of the found structure
  , forall b a. RecognitionState b a -> [SearchLog a]
_recognitionLog :: [SearchLog a]
  }
  deriving ((forall x. RecognitionState b a -> Rep (RecognitionState b a) x)
-> (forall x. Rep (RecognitionState b a) x -> RecognitionState b a)
-> Generic (RecognitionState b a)
forall x. Rep (RecognitionState b a) x -> RecognitionState b a
forall x. RecognitionState b a -> Rep (RecognitionState b a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall b a x. Rep (RecognitionState b a) x -> RecognitionState b a
forall b a x. RecognitionState b a -> Rep (RecognitionState b a) x
$cfrom :: forall b a x. RecognitionState b a -> Rep (RecognitionState b a) x
from :: forall x. RecognitionState b a -> Rep (RecognitionState b a) x
$cto :: forall b a x. Rep (RecognitionState b a) x -> RecognitionState b a
to :: forall x. Rep (RecognitionState b a) x -> RecognitionState b a
Generic)

makeLenses ''RecognitionState