fsharp(ygosim): feat: added a few basic files
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
40173d0b58
commit
b842f8a14e
2
fsharp/ygosim/.gitignore
vendored
2
fsharp/ygosim/.gitignore
vendored
|
@ -431,3 +431,5 @@ $RECYCLE.BIN/
|
|||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
.ionide
|
|
@ -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
|
6
fsharp/ygosim/src/Board.fs
Normal file
6
fsharp/ygosim/src/Board.fs
Normal file
|
@ -0,0 +1,6 @@
|
|||
module Board
|
||||
|
||||
open Player
|
||||
|
||||
type Board =
|
||||
{ players: Player.Player * Player }
|
4
fsharp/ygosim/src/Card.fs
Normal file
4
fsharp/ygosim/src/Card.fs
Normal file
|
@ -0,0 +1,4 @@
|
|||
module Card
|
||||
|
||||
type Card =
|
||||
{ name: string }
|
19
fsharp/ygosim/src/Player.fs
Normal file
19
fsharp/ygosim/src/Player.fs
Normal 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)
|
||||
|
0
fsharp/ygosim/src/PlayerController.fs
Normal file
0
fsharp/ygosim/src/PlayerController.fs
Normal file
5
fsharp/ygosim/src/Program.fs
Normal file
5
fsharp/ygosim/src/Program.fs
Normal 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
10
fsharp/ygosim/src/Side.fs
Normal 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 }
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue