diff options
Diffstat (limited to '')
-rw-r--r-- | haskell/src/SpaceTraders/Model/Agent.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/haskell/src/SpaceTraders/Model/Agent.hs b/haskell/src/SpaceTraders/Model/Agent.hs new file mode 100644 index 0000000..be97ac4 --- /dev/null +++ b/haskell/src/SpaceTraders/Model/Agent.hs @@ -0,0 +1,22 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} + +module SpaceTraders.Model.Agent + ( Agent(accountId, credits, headquarters) + , agentSymbol + ) where + +import Data.Aeson +import GHC.Generics +import qualified Data.Text as T + +data Agent = Agent { accountId :: T.Text + , credits :: Integer + , headquarters :: T.Text + , startingFaction :: T.Text + , symbol :: T.Text + } deriving (FromJSON, Generic, Show, ToJSON) + +agentSymbol :: Agent -> T.Text +agentSymbol = symbol |