use int in game logic
This commit is contained in:
+6
-6
@@ -13,20 +13,20 @@ COLORS :: enum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Card :: struct {
|
Card :: struct {
|
||||||
value: u8,
|
value: int,
|
||||||
color: COLORS,
|
color: COLORS,
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUES: []u8 : {1, 1, 1, 2, 2, 3, 3, 4, 4, 5}
|
VALUES: []int : {1, 1, 1, 2, 2, 3, 3, 4, 4, 5}
|
||||||
|
|
||||||
Player :: struct {
|
Player :: struct {
|
||||||
hand: [dynamic]Card,
|
hand: [dynamic]Card,
|
||||||
}
|
}
|
||||||
|
|
||||||
Game :: struct {
|
Game :: struct {
|
||||||
num_players: u8,
|
num_players: int,
|
||||||
hint_tokens: u8,
|
hint_tokens: int,
|
||||||
lives_left: u8,
|
lives_left: int,
|
||||||
players: [dynamic]Player,
|
players: [dynamic]Player,
|
||||||
deck: [dynamic]Card,
|
deck: [dynamic]Card,
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ create_player :: proc(s: ^Game) -> (p: Player) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
create_game :: proc(hint_tokens, lives_left, num_players: u8) -> (s: Game) {
|
create_game :: proc(hint_tokens, lives_left, num_players: int) -> (s: Game) {
|
||||||
assert(num_players > 1 && num_players < 6)
|
assert(num_players > 1 && num_players < 6)
|
||||||
s.hint_tokens = hint_tokens
|
s.hint_tokens = hint_tokens
|
||||||
s.lives_left = lives_left
|
s.lives_left = lives_left
|
||||||
|
|||||||
Reference in New Issue
Block a user