Applying linter suggestions
PascalCase of types No need to wrap envToString in function since it doesn't have partial state stored.
This commit is contained in:
parent
2d476189d9
commit
c1083e8f0c
|
@ -1,7 +1,7 @@
|
||||||
module Game.Game
|
module Game.Game
|
||||||
|
|
||||||
|
|
||||||
type wallType =
|
type WallType =
|
||||||
| NS
|
| NS
|
||||||
| EW
|
| EW
|
||||||
| NE
|
| NE
|
||||||
|
@ -10,36 +10,36 @@ type wallType =
|
||||||
| SW
|
| SW
|
||||||
| Corner
|
| Corner
|
||||||
|
|
||||||
type direction =
|
type Direction =
|
||||||
| North
|
| North
|
||||||
| South
|
| South
|
||||||
| East
|
| East
|
||||||
| West
|
| West
|
||||||
|
|
||||||
type env =
|
type Env =
|
||||||
| Wall of wallType
|
| Wall of WallType
|
||||||
| Floor
|
| Floor
|
||||||
| Trap
|
| Trap
|
||||||
| Player
|
| Player
|
||||||
|
|
||||||
type cast = {
|
type Cast = {
|
||||||
spell: string
|
spell: string
|
||||||
direction: direction
|
direction: Direction
|
||||||
}
|
}
|
||||||
type command =
|
type Command =
|
||||||
| Move of direction
|
| Move of Direction
|
||||||
| Refresh
|
| Refresh
|
||||||
| Cast of cast
|
| Cast of Cast
|
||||||
|
|
||||||
type location =
|
type Location =
|
||||||
{
|
{
|
||||||
x: int
|
x: int
|
||||||
y: int
|
y: int
|
||||||
}
|
}
|
||||||
type state =
|
type State =
|
||||||
{
|
{
|
||||||
board: string
|
board: string
|
||||||
playerLocation: location
|
playerLocation: Location
|
||||||
}
|
}
|
||||||
|
|
||||||
let envToString e =
|
let envToString e =
|
||||||
|
@ -61,6 +61,6 @@ let rowToString = List.fold (fun r e -> r + envToString e) ""
|
||||||
|
|
||||||
let floorToString = List.fold (fun f r -> f + rowToString r + "\n") ""
|
let floorToString = List.fold (fun f r -> f + rowToString r + "\n") ""
|
||||||
|
|
||||||
let rowToStringList = List.map (fun e -> envToString e)
|
let rowToStringList = List.map envToString
|
||||||
|
|
||||||
let floorToStringLists = List.map rowToStringList
|
let floorToStringLists = List.map rowToStringList
|
Loading…
Reference in New Issue