fsharp(ygosim): feat: added a way of creating a new board
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
b842f8a14e
commit
c6689fd6fa
|
@ -3,4 +3,6 @@ module Board
|
||||||
open Player
|
open Player
|
||||||
|
|
||||||
type Board =
|
type Board =
|
||||||
{ players: Player.Player * Player }
|
{ players: Player * Player }
|
||||||
|
|
||||||
|
let emptyBoard = { players = (initialPlayer 8000, initialPlayer 8000) }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
module Card
|
module Card
|
||||||
|
|
||||||
|
// TODO: actually implement it
|
||||||
type Card =
|
type Card =
|
||||||
{ name: string }
|
{ name: string }
|
||||||
|
|
|
@ -8,12 +8,6 @@ type Player =
|
||||||
|
|
||||||
let inflictDamage (player: Player) amount = { player with lifePoints = player.lifePoints - amount }
|
let inflictDamage (player: Player) amount = { player with lifePoints = player.lifePoints - amount }
|
||||||
|
|
||||||
|
let initialPlayer lp =
|
||||||
type PlayerControllerAction =
|
{ lifePoints = lp
|
||||||
| ChooseZone
|
side = emptySide }
|
||||||
| BoardUpdate
|
|
||||||
|
|
||||||
type PlayerActionPayload = PlayerControllerAction * Side
|
|
||||||
|
|
||||||
type PlayerController = PlayerController of (PlayerControllerAction -> PlayerController)
|
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,15 @@ module Side
|
||||||
open Card
|
open Card
|
||||||
|
|
||||||
type Side =
|
type Side =
|
||||||
{ field: Card
|
{ field: Card option
|
||||||
monsters: Card list
|
monsters: Card list
|
||||||
spells: Card list
|
spells: Card list
|
||||||
graveyard: Card list
|
graveyard: Card list
|
||||||
deck: Card list }
|
deck: Card list }
|
||||||
|
|
||||||
|
let emptySide =
|
||||||
|
{ field = None
|
||||||
|
monsters = []
|
||||||
|
spells = []
|
||||||
|
graveyard = []
|
||||||
|
deck = [] }
|
||||||
|
|
Loading…
Reference in a new issue