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
|
||||
|
||||
type Board =
|
||||
{ players: Player.Player * Player }
|
||||
{ players: Player * Player }
|
||||
|
||||
let emptyBoard = { players = (initialPlayer 8000, initialPlayer 8000) }
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
module Card
|
||||
|
||||
// TODO: actually implement it
|
||||
type Card =
|
||||
{ name: string }
|
||||
|
|
|
@ -8,12 +8,6 @@ type Player =
|
|||
|
||||
let inflictDamage (player: Player) amount = { player with lifePoints = player.lifePoints - amount }
|
||||
|
||||
|
||||
type PlayerControllerAction =
|
||||
| ChooseZone
|
||||
| BoardUpdate
|
||||
|
||||
type PlayerActionPayload = PlayerControllerAction * Side
|
||||
|
||||
type PlayerController = PlayerController of (PlayerControllerAction -> PlayerController)
|
||||
|
||||
let initialPlayer lp =
|
||||
{ lifePoints = lp
|
||||
side = emptySide }
|
||||
|
|
|
@ -3,8 +3,15 @@ module Side
|
|||
open Card
|
||||
|
||||
type Side =
|
||||
{ field: Card
|
||||
{ field: Card option
|
||||
monsters: Card list
|
||||
spells: Card list
|
||||
graveyard: Card list
|
||||
deck: Card list }
|
||||
|
||||
let emptySide =
|
||||
{ field = None
|
||||
monsters = []
|
||||
spells = []
|
||||
graveyard = []
|
||||
deck = [] }
|
||||
|
|
Loading…
Reference in a new issue