Rename type «Pokemon» for to follow the same convention as other types
This commit is contained in:
parent
2a3a56ad01
commit
6633f0221b
4 changed files with 10 additions and 10 deletions
|
@ -11,7 +11,7 @@ import Area.NaturalElements (NaturalElements)
|
|||
import Area.Climate (Climate)
|
||||
import qualified Character (Key)
|
||||
import qualified Item (Key)
|
||||
import qualified Pokemon (T)
|
||||
import Pokemon (Pokemon)
|
||||
|
||||
data Terrain = Normal | Water deriving (Generic)
|
||||
|
||||
|
@ -24,7 +24,7 @@ data Content =
|
|||
Empty
|
||||
| Item Item.Key
|
||||
| Character Character.Key
|
||||
| Pokemon Pokemon.T
|
||||
| Pokemon Pokemon
|
||||
| NaturalElements NaturalElements
|
||||
deriving (Generic)
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@ import Data.Aeson (ToJSON(..), FromJSON(..), genericToEncoding, genericParseJSON
|
|||
import Data.Vector (Vector)
|
||||
import GHC.Generics (Generic)
|
||||
import Gender (Gender(..))
|
||||
import qualified Pokemon (T)
|
||||
import Pokemon (Pokemon)
|
||||
import Tool.Array (Array)
|
||||
|
||||
data Character = Character {
|
||||
name :: String
|
||||
, skin :: FilePath
|
||||
, gender :: Gender
|
||||
, pokemons :: Array Pokemon.T
|
||||
, pokemons :: Array Pokemon
|
||||
} deriving (Generic)
|
||||
|
||||
instance ToJSON Character where
|
||||
|
|
|
@ -10,9 +10,9 @@ module Item (
|
|||
import Data.Aeson (ToJSON(..), FromJSON(..), genericToEncoding, genericParseJSON, defaultOptions)
|
||||
import Data.Vector (Vector)
|
||||
import GHC.Generics (Generic)
|
||||
import qualified Pokemon (T)
|
||||
import Pokemon (Pokemon)
|
||||
|
||||
data Type = Hold | Transform (Pokemon.T -> Pokemon.T) | Special
|
||||
data Type = Hold | Transform (Pokemon -> Pokemon) | Special
|
||||
|
||||
data Item = Item {
|
||||
name :: String
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{-# LANGUAGE DeriveGeneric #-}
|
||||
module Pokemon (
|
||||
T(..)
|
||||
Pokemon(..)
|
||||
) where
|
||||
|
||||
import Data.Aeson (ToJSON(..), FromJSON(..), genericToEncoding, genericParseJSON, defaultOptions)
|
||||
|
@ -12,7 +12,7 @@ import Pokemon.Status (Status)
|
|||
import qualified Pokemon.Move as Move (Key)
|
||||
import Tool.Array (Array)
|
||||
|
||||
data T = T {
|
||||
data Pokemon = Pokemon {
|
||||
nick :: Maybe String
|
||||
, species :: Species.Key
|
||||
, gender :: Gender
|
||||
|
@ -21,7 +21,7 @@ data T = T {
|
|||
, moves :: Array Move.Key
|
||||
} deriving (Generic)
|
||||
|
||||
instance ToJSON T where
|
||||
instance ToJSON Pokemon where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON T where
|
||||
instance FromJSON Pokemon where
|
||||
parseJSON = genericParseJSON defaultOptions
|
||||
|
|
Loading…
Reference in a new issue