-- | Command groups
module Calamity.Commands.Group
    ( Group(..) ) where

import           Calamity.Commands.Check
import {-# SOURCE #-} Calamity.Commands.Command
import {-# SOURCE #-} Calamity.Commands.Context

import qualified Data.HashMap.Lazy         as LH
import qualified Data.Text                 as S
import qualified Data.Text.Lazy            as L

import           GHC.Generics

data Group = Group
  { Group -> Text
name     :: S.Text
  , Group -> Maybe Group
parent   :: Maybe Group
  , Group -> HashMap Text Command
commands :: LH.HashMap S.Text Command
  , Group -> HashMap Text Group
children :: LH.HashMap S.Text Group
  , Group -> Context -> Text
help     :: Context -> L.Text
  , Group -> [Check]
checks   :: [Check]
  }
  deriving ( (forall x. Group -> Rep Group x)
-> (forall x. Rep Group x -> Group) -> Generic Group
forall x. Rep Group x -> Group
forall x. Group -> Rep Group x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Group x -> Group
$cfrom :: forall x. Group -> Rep Group x
Generic )