|
|
@ -162,6 +162,24 @@ export class GameStateService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return(score);
|
|
|
|
return(score);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_boat_count(){
|
|
|
|
|
|
|
|
let i = 1;
|
|
|
|
|
|
|
|
let j = 1;
|
|
|
|
|
|
|
|
let boat_count = 0;
|
|
|
|
|
|
|
|
for(i; i<=9; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for(j; j<=9; j++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let cell = this.player_x_game_board[this.current_opponent][i][j];
|
|
|
|
|
|
|
|
if(cell.render === GridCellState.Damaged || cell.render === GridCellState.Sunk || cell.render === GridCellState.Ship )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
boat_count++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return(boat_count);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export a single instance, so it can be shared by all files
|
|
|
|
// Export a single instance, so it can be shared by all files
|
|
|
|