fsharp(ygosim): chore: grouped the Board, Side and Player modules
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
c6689fd6fa
commit
34751250ae
|
@ -1,5 +1,39 @@
|
|||
module Board
|
||||
|
||||
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 = [] }
|
||||
|
||||
|
||||
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 =
|
||||
|
|
|
@ -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 }
|
|
@ -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 = [] }
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Compile Include="src/Card.fs" />
|
||||
<Compile Include="src/Side.fs" />
|
||||
<Compile Include="src/Player.fs" />
|
||||
<Compile Include="src/Board.fs" />
|
||||
<Compile Include="src/Program.fs" />
|
||||
</ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue