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