summaryrefslogtreecommitdiff
path: root/haskell/src/SpaceTraders/Model/Ship.hs
blob: 2ec54f18f8ae7e3a53adfb41124595078970f647 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}

module SpaceTraders.Model.Ship
  ( Ship(..)
  ) where

import Data.Aeson
import GHC.Generics
import qualified Data.Text as T

import SpaceTraders.Model.Cargo
import SpaceTraders.Model.Fuel
import SpaceTraders.Model.Nav

data Ship = Ship { cargo :: Cargo
                 , cooldown :: Cooldown
                 --, crew :: Crew
                 --, engine :: Engine
                 --, frame :: Frame
                 , fuel :: Fuel
                 --, modules :: [Module]
                 --, mounts :: [Mount]
                 , nav :: Nav
                 --, reactor :: Reactor
                 --, registration :: Registration
                 , symbol :: T.Text
                 } deriving (FromJSON, Generic, Show, ToJSON)

data Cooldown = Cooldown { shipSymbol :: T.Text
                         , totalSeconds :: Int
                         , remainingSeconds :: Int
                         } deriving (FromJSON, Generic, Show, ToJSON)