{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
module Unit where

import Data.Aeson
import GHC.Generics
import Control.Lens

import GPS
import Color
import Type
import Size
import RCP
import Posture
import Facing
import CommandControl

type UnitId = Int

data Unit = Unit
  { _unitPos :: GPS
  , _unitColor :: Color
  , _unitName :: String
  , _unitType :: Type
  , _unitSize :: Size
  , _unitBaseRCP :: RCP
  , _unitRCP :: RCP
  , _unitPosture :: Posture
  , _unitFacing :: Facing
  , _unitWaypoints :: [GPS]
--  , unitMOPP4 :: Bool
--  , unitMission :: Mission
--  , unitSuppression :: Suppression
--  , unitMorale :: Morale
--  , unitFatigue :: Fatigue
--  , unitCFZ :: Bool
--  , unitLogisticsStatus :: LogisticsStatus
  -- XXX supply convoy, wsro
  , _unitCommandControlStatus :: CommandControlStatus
  , _unitHQId :: UnitId
  , _unitId :: UnitId
  } deriving (Eq, Show, Generic)


makeLenses ''Unit


instance FromJSON Unit
instance ToJSON Unit

-- | Intel
type UnitProjection = Unit -- XXX


