-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathboard.mli
56 lines (50 loc) · 1.61 KB
/
board.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
open Deck
open Hero
open Draft
open Command
(* keep track of current mana available to player at a given time
* max is the mana you start with next turn
*)
type mana = {
max : int ref;
current : int ref;
}
(* mode defines whether or not it is player vs player or player vs ai *)
type mode = |VSai of bool |PVP
(* board keeps track of all the different aspects of the game at the current
* state.
* mode keeps track of game mode
* p___Hero keeps track of which hero each player is using
* p___HP is the current hitpoints of player
* p___Hand is the list of cards in a player's hand
* p___Board is the cards currently on each side of the board
* p___Deck is each respective player's current deck
* hUsed is whether or not the player used their hero power that turn
* p___Mana is the mana for each player
* turn is 0 or 1 depending on who's player's turn it is
*)
type board = {
mode : mode ref;
pOneHero : hero;
pTwoHero : hero;
pOneHP : int ref;
pTwoHP : int ref;
pOneHand : card list ref;
pTwoHand : card list ref;
pOneBoard : card option array;
pTwoBoard : card option array;
pOneDeck : deck ref;
pTwoDeck : deck ref;
hUsed : bool ref;
pOneMana : mana;
pTwoMana : mana;
turn : int ref;
}
(* [makeBoard] takes in the two hero deck tuples and creates the
* starting board state
*)
val makeBoard : (hero * deck) -> (hero * deck) -> mode -> board
(* [actualGame] acts as a main funciton that starts the command parsing
*)
val actualGame : (hero * deck)-> (hero * deck) -> mode ref-> unit
val menu : card array -> hero array -> (hero * deck)-> (hero * deck) -> mode -> unit