1
Fork 0

fsharp(ygosim): feat: added a few basic files

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-12-05 19:17:05 +02:00 committed by prescientmoon
parent 40173d0b58
commit b842f8a14e
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
9 changed files with 51 additions and 9 deletions

View file

@ -431,3 +431,5 @@ $RECYCLE.BIN/
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.ionide

View file

@ -1,8 +0,0 @@
// Learn more about F# at http://fsharp.org
open System
[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
0 // return an integer exit code

View file

@ -0,0 +1,6 @@
module Board
open Player
type Board =
{ players: Player.Player * Player }

View file

@ -0,0 +1,4 @@
module Card
type Card =
{ name: string }

View file

@ -0,0 +1,19 @@
module Player
open Side
type Player =
{ lifePoints: int
side: Side }
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)

View file

View file

@ -0,0 +1,5 @@
module Main =
[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
0 // return an integer exit code

10
fsharp/ygosim/src/Side.fs Normal file
View file

@ -0,0 +1,10 @@
module Side
open Card
type Side =
{ field: Card
monsters: Card list
spells: Card list
graveyard: Card list
deck: Card list }

View file

@ -6,7 +6,11 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
<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>
</Project>