1
Fork 0

fsharp(ygosim): feat: added a way of creating a new board

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-12-05 19:25:03 +02:00 committed by prescientmoon
parent b842f8a14e
commit c6689fd6fa
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
5 changed files with 15 additions and 11 deletions

View file

@ -3,4 +3,6 @@ module Board
open Player
type Board =
{ players: Player.Player * Player }
{ players: Player * Player }
let emptyBoard = { players = (initialPlayer 8000, initialPlayer 8000) }

View file

@ -1,4 +1,5 @@
module Card
// TODO: actually implement it
type Card =
{ name: string }

View file

@ -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 }

View file

@ -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 = [] }