diff options
author | Julien Dessaux | 2023-07-02 22:58:30 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-07-02 23:01:01 +0200 |
commit | a775330b4fa17fb367e55343e6fda6c7ae9e34b4 (patch) | |
tree | 8c572f799dbf434459d4659e32559c121421f120 /haskell/src/SpaceTraders/Model | |
parent | Moved the nodejs agent to its own subfolder to make room for my haskell agent (diff) | |
download | spacetraders-a775330b4fa17fb367e55343e6fda6c7ae9e34b4.tar.gz spacetraders-a775330b4fa17fb367e55343e6fda6c7ae9e34b4.tar.bz2 spacetraders-a775330b4fa17fb367e55343e6fda6c7ae9e34b4.zip |
Bootstrapped my haskell client
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 |