bot game result
This commit is contained in:
parent
4b848f1e02
commit
14c779f484
@ -262,7 +262,7 @@ class ItemList extends Phaser.Scene {
|
|||||||
console.log(name);
|
console.log(name);
|
||||||
const SCORE_X = ITEM_WIDTH * 11;
|
const SCORE_X = ITEM_WIDTH * 11;
|
||||||
const SCORE_Y = ITEM_HEIGHT * 1.1 * (i + 2);
|
const SCORE_Y = ITEM_HEIGHT * 1.1 * (i + 2);
|
||||||
this.add.text(SCORE_X, SCORE_Y, `${name} | ${score.wins} - ${score.losses}`, TEXT.NORMAL);
|
this.add.text(SCORE_X, SCORE_Y, `${score.wins} - ${score.losses} | ${name}`, TEXT.NORMAL);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add Handlers
|
// Add Handlers
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
# WORK WORK
|
# WORK WORK
|
||||||
## NOW
|
## NOW
|
||||||
scoreboard
|
|
||||||
cryp vbox
|
cryp vbox
|
||||||
constants
|
constants
|
||||||
change to ownership pattern
|
change to ownership pattern
|
||||||
|
|||||||
@ -103,7 +103,7 @@ impl Instance {
|
|||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bot_vs_player_game(&self, player: &Player) -> Game {
|
fn bot_vs_player_game(&self, player: &Player) -> Result<Game, Error> {
|
||||||
let current_round = self.current_round(player);
|
let current_round = self.current_round(player);
|
||||||
|
|
||||||
let plr = self.players.clone().into_iter().find(|p| p.id == player.id).unwrap();
|
let plr = self.players.clone().into_iter().find(|p| p.id == player.id).unwrap();
|
||||||
@ -125,12 +125,12 @@ impl Instance {
|
|||||||
bot_team.set_bot();
|
bot_team.set_bot();
|
||||||
|
|
||||||
game
|
game
|
||||||
.team_add(plr_team).unwrap()
|
.team_add(plr_team)?
|
||||||
.team_add(bot_team).unwrap();
|
.team_add(bot_team)?;
|
||||||
|
|
||||||
game.start();
|
game.start();
|
||||||
|
|
||||||
game
|
Ok(game)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn can_start(&self) -> bool {
|
fn can_start(&self) -> bool {
|
||||||
@ -485,7 +485,7 @@ pub fn instance_ready(params: InstanceReadyParams, tx: &mut Transaction, account
|
|||||||
true => match game_get(tx, game_id) {
|
true => match game_get(tx, game_id) {
|
||||||
Ok(g) => g,
|
Ok(g) => g,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
let game = instance.bot_vs_player_game(&player);
|
let game = instance.bot_vs_player_game(&player)?;
|
||||||
game_write(&game, tx)?;
|
game_write(&game, tx)?;
|
||||||
game
|
game
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user