62 lines
No EOL
1.4 KiB
Haskell
62 lines
No EOL
1.4 KiB
Haskell
module RPGEngine.Data.Defaults where
|
|
|
|
import RPGEngine.Data
|
|
|
|
defaultEntity :: Entity
|
|
defaultEntity = Entity {
|
|
entityId = "",
|
|
entityX = 0,
|
|
entityY = 0,
|
|
entityName = "Default",
|
|
entityDescription = "",
|
|
entityActions = [],
|
|
entityValue = Prelude.Nothing,
|
|
entityHp = Prelude.Nothing,
|
|
direction = Center
|
|
}
|
|
|
|
-- Initialize the game
|
|
initGame :: Game
|
|
initGame = Game {
|
|
state = defaultState,
|
|
playing = defaultLevel,
|
|
levels = [defaultLevel],
|
|
player = defaultPlayer
|
|
}
|
|
|
|
defaultItem :: Item
|
|
defaultItem = Item {
|
|
itemId = "",
|
|
itemX = 0,
|
|
itemY = 0,
|
|
itemName = "Default",
|
|
itemDescription = "",
|
|
itemActions = [],
|
|
itemValue = Prelude.Nothing,
|
|
useTimes = Prelude.Nothing
|
|
}
|
|
|
|
defaultLayout :: Layout
|
|
defaultLayout = [
|
|
[Blocked, Blocked, Blocked, Blocked, Blocked, Blocked, Blocked, Blocked],
|
|
[Blocked, Entrance, Walkable, Walkable, Walkable, Walkable, Exit, Blocked],
|
|
[Blocked, Blocked, Blocked, Blocked, Blocked, Blocked, Blocked, Blocked]
|
|
]
|
|
|
|
defaultLevel :: Level
|
|
defaultLevel = Level {
|
|
layout = defaultLayout,
|
|
items = [],
|
|
entities = []
|
|
}
|
|
|
|
defaultPlayer :: Player
|
|
defaultPlayer = Player {
|
|
playerHp = Prelude.Nothing, -- Compares to infinity
|
|
inventory = [],
|
|
coord = (0, 0)
|
|
}
|
|
|
|
-- Default state of the game, Menu
|
|
defaultState :: State
|
|
defaultState = Menu |