|
|
|
@ -3,7 +3,6 @@ import {GameState, ShipType} from '../module/util.js'
|
|
|
|
|
import game_service from '../services/GameState.service.js'
|
|
|
|
|
|
|
|
|
|
const template = `
|
|
|
|
|
<<<<<<< Updated upstream
|
|
|
|
|
<div class="top-level-container">
|
|
|
|
|
<div class="top-level-component">
|
|
|
|
|
<div v-if="current_state === GameState.ChoosingNumberOfShips">
|
|
|
|
@ -13,24 +12,6 @@ const template = `
|
|
|
|
|
<button @click="ship(3)" class="shipBtn">3 ships</button>
|
|
|
|
|
<button @click="ship(4)" class="shipBtn">4 ships</button>
|
|
|
|
|
<button @click="ship(5)" class="shipBtn">5 ships</button>
|
|
|
|
|
=======
|
|
|
|
|
<div class="top-level-component">
|
|
|
|
|
<div v-if="current_state === GameState.ChoosingNumberOfShips">
|
|
|
|
|
Choose number of ships:
|
|
|
|
|
<button @click="ship1" class="shipBtn">1 ship</button>
|
|
|
|
|
<button @click="ship2" class="shipBtn">2 ships</button>
|
|
|
|
|
<button @click="ship3" class="shipBtn">3 ships</button>
|
|
|
|
|
<button @click="ship4" class="shipBtn">4 ships</button>
|
|
|
|
|
<button @click="ship5" class="shipBtn">5 ships</button>
|
|
|
|
|
</div>
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> 19aa3733d0604f37e6875b825eb51ccd4092d4c4
|
|
|
|
|
<div v-if="current_state !== GameState.ChoosingNumberOfShips" class="game-boards-container">
|
|
|
|
|
<!-- Opponent's board -->
|
|
|
|
|
<div class="game-board">
|
|
|
|
|
<app-game-board v-bind:rows="opponent_rows"></app-game-board>
|
|
|
|
|
>>>>>>> Stashed changes
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="current_state !== GameState.ChoosingNumberOfShips" class="game-boards-container">
|
|
|
|
|
<!-- Opponent's board -->
|
|
|
|
@ -113,8 +94,7 @@ export default class TopLevelComponent extends Component {
|
|
|
|
|
|
|
|
|
|
this.player_is_placing_ships = next_state === GameState.PlayerSetup
|
|
|
|
|
if ( !was_refresh && this.player_is_placing_ships ) {
|
|
|
|
|
// TODO replace with call to game state service
|
|
|
|
|
this.ships_to_place = [ShipType.x1, ShipType.x2, ShipType.x3]
|
|
|
|
|
this.ships_to_place = game_service.get_possible_boats()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO add code for instructions
|
|
|
|
|