Bootstrapped my haskell client
This commit is contained in:
parent
36cc33f9e9
commit
a775330b4f
12 changed files with 389 additions and 2 deletions
22
haskell/src/SpaceTraders/Model/Agent.hs
Normal file
22
haskell/src/SpaceTraders/Model/Agent.hs
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue