{-# LANGUAGE TemplateHaskell #-}

-- |
-- SPDX-License-Identifier: BSD-3-Clause
--
-- Public interface for structure recognizer.
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
import Swarm.Game.Scenario.Topography.Structure.Recognition.Type

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

makeLenses ''StructureRecognizer