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 Area.Climate (Climate)
|
||||||
import qualified Character (Key)
|
import qualified Character (Key)
|
||||||
import qualified Item (Key)
|
import qualified Item (Key)
|
||||||
import qualified Pokemon (T)
|
import Pokemon (Pokemon)
|
||||||
|
|
||||||
data Terrain = Normal | Water deriving (Generic)
|
data Terrain = Normal | Water deriving (Generic)
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ data Content =
|
||||||
Empty
|
Empty
|
||||||
| Item Item.Key
|
| Item Item.Key
|
||||||
| Character Character.Key
|
| Character Character.Key
|
||||||
| Pokemon Pokemon.T
|
| Pokemon Pokemon
|
||||||
| NaturalElements NaturalElements
|
| NaturalElements NaturalElements
|
||||||
deriving (Generic)
|
deriving (Generic)
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,14 @@ import Data.Aeson (ToJSON(..), FromJSON(..), genericToEncoding, genericParseJSON
|
||||||
import Data.Vector (Vector)
|
import Data.Vector (Vector)
|
||||||
import GHC.Generics (Generic)
|
import GHC.Generics (Generic)
|
||||||
import Gender (Gender(..))
|
import Gender (Gender(..))
|
||||||
import qualified Pokemon (T)
|
import Pokemon (Pokemon)
|
||||||
import Tool.Array (Array)
|
import Tool.Array (Array)
|
||||||
|
|
||||||
data Character = Character {
|
data Character = Character {
|
||||||
name :: String
|
name :: String
|
||||||
, skin :: FilePath
|
, skin :: FilePath
|
||||||
, gender :: Gender
|
, gender :: Gender
|
||||||
, pokemons :: Array Pokemon.T
|
, pokemons :: Array Pokemon
|
||||||
} deriving (Generic)
|
} deriving (Generic)
|
||||||
|
|
||||||
instance ToJSON Character where
|
instance ToJSON Character where
|
||||||
|
|
|
@ -10,9 +10,9 @@ module Item (
|
||||||
import Data.Aeson (ToJSON(..), FromJSON(..), genericToEncoding, genericParseJSON, defaultOptions)
|
import Data.Aeson (ToJSON(..), FromJSON(..), genericToEncoding, genericParseJSON, defaultOptions)
|
||||||
import Data.Vector (Vector)
|
import Data.Vector (Vector)
|
||||||
import GHC.Generics (Generic)
|
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 {
|
data Item = Item {
|
||||||
name :: String
|
name :: String
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{-# LANGUAGE DeriveGeneric #-}
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
module Pokemon (
|
module Pokemon (
|
||||||
T(..)
|
Pokemon(..)
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Aeson (ToJSON(..), FromJSON(..), genericToEncoding, genericParseJSON, defaultOptions)
|
import Data.Aeson (ToJSON(..), FromJSON(..), genericToEncoding, genericParseJSON, defaultOptions)
|
||||||
|
@ -12,7 +12,7 @@ import Pokemon.Status (Status)
|
||||||
import qualified Pokemon.Move as Move (Key)
|
import qualified Pokemon.Move as Move (Key)
|
||||||
import Tool.Array (Array)
|
import Tool.Array (Array)
|
||||||
|
|
||||||
data T = T {
|
data Pokemon = Pokemon {
|
||||||
nick :: Maybe String
|
nick :: Maybe String
|
||||||
, species :: Species.Key
|
, species :: Species.Key
|
||||||
, gender :: Gender
|
, gender :: Gender
|
||||||
|
@ -21,7 +21,7 @@ data T = T {
|
||||||
, moves :: Array Move.Key
|
, moves :: Array Move.Key
|
||||||
} deriving (Generic)
|
} deriving (Generic)
|
||||||
|
|
||||||
instance ToJSON T where
|
instance ToJSON Pokemon where
|
||||||
toEncoding = genericToEncoding defaultOptions
|
toEncoding = genericToEncoding defaultOptions
|
||||||
instance FromJSON T where
|
instance FromJSON Pokemon where
|
||||||
parseJSON = genericParseJSON defaultOptions
|
parseJSON = genericParseJSON defaultOptions
|
||||||
|
|
Loading…
Reference in a new issue