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 open Player
type Board = type Board =
{ players: Player.Player * Player } { players: Player * Player }
let emptyBoard = { players = (initialPlayer 8000, initialPlayer 8000) }

View file

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

View file

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

View file

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