diff --git a/fsharp/ygosim/src/Board.fs b/fsharp/ygosim/src/Board.fs index 64aa8f4..69e349e 100644 --- a/fsharp/ygosim/src/Board.fs +++ b/fsharp/ygosim/src/Board.fs @@ -1,8 +1,42 @@ module Board -open Player +module Side = + open Card -type Board = - { players: Player * Player } + type Side = + { field: Card option + monsters: Card list + spells: Card list + graveyard: Card list + deck: Card list } -let emptyBoard = { players = (initialPlayer 8000, initialPlayer 8000) } + let emptySide = + { field = None + monsters = [] + spells = [] + graveyard = [] + deck = [] } + + +module Player = + open Side + + type Player = + { lifePoints: int + side: Side } + + let inflictDamage (player: Player) amount = { player with lifePoints = player.lifePoints - amount } + + let initialPlayer lp = + { lifePoints = lp + side = emptySide } + + + +module Board = + open Player + + type Board = + { players: Player * Player } + + let emptyBoard = { players = (initialPlayer 8000, initialPlayer 8000) } diff --git a/fsharp/ygosim/src/Player.fs b/fsharp/ygosim/src/Player.fs deleted file mode 100644 index 7ed00f5..0000000 --- a/fsharp/ygosim/src/Player.fs +++ /dev/null @@ -1,13 +0,0 @@ -module Player - -open Side - -type Player = - { lifePoints: int - side: Side } - -let inflictDamage (player: Player) amount = { player with lifePoints = player.lifePoints - amount } - -let initialPlayer lp = - { lifePoints = lp - side = emptySide } diff --git a/fsharp/ygosim/src/Side.fs b/fsharp/ygosim/src/Side.fs deleted file mode 100644 index 493852c..0000000 --- a/fsharp/ygosim/src/Side.fs +++ /dev/null @@ -1,17 +0,0 @@ -module Side - -open Card - -type Side = - { field: Card option - monsters: Card list - spells: Card list - graveyard: Card list - deck: Card list } - -let emptySide = - { field = None - monsters = [] - spells = [] - graveyard = [] - deck = [] } diff --git a/fsharp/ygosim/ygosim.fsproj b/fsharp/ygosim/ygosim.fsproj index f2badb6..607de4c 100644 --- a/fsharp/ygosim/ygosim.fsproj +++ b/fsharp/ygosim/ygosim.fsproj @@ -7,8 +7,6 @@ - -