Remove logs and fix startDicePerPlayer

This commit is contained in:
Tim 2021-12-02 03:23:29 +01:00
parent 2274c63f59
commit de6aa57e45
2 changed files with 5 additions and 9 deletions

View File

@ -39,12 +39,12 @@ export default class GameRulesEditor extends Vue {
@Prop() private value!: GameRules;
@Prop() private readonly!: boolean;
private get startDicePerPlayer (): number {
private get startDicePerPlayer (): number|string {
return this.value.startDicePerPlayer;
}
private set startDicePerPlayer (b: number) {
this.value.startDicePerPlayer = b;
private set startDicePerPlayer (b: number|string) {
this.value.startDicePerPlayer = parseInt(b.toString());
this.emitRules();
}

View File

@ -204,7 +204,6 @@ export default class Home extends Vue {
}
private set rules (gameRules: GameRules | undefined) {
console.log(gameRules);
if (this.playerId && gameRules) {
PerudoApi.instance.setGameRules(this.playerId, gameRules);
}
@ -296,11 +295,10 @@ export default class Home extends Vue {
}
private checkStarted (): void {
console.log("Check started");
// console.log("Check started");
if (this.gameJoined && this.playerId) {
PerudoApi.instance.gameStarted(this.playerId).then((response: IsStartedObject) => {
this.gameStateObject = response.gameState;
console.log(this.gameStateObject.rules);
if (response.started) {
this.gameState = GameState.Started;
@ -316,7 +314,7 @@ export default class Home extends Vue {
}
private checkTurn (): void {
console.log("Check turn");
// console.log("Check turn");
if (this.gameStarted && this.playerId) {
PerudoApi.instance.myTurn(this.playerId).then((response: MyTurnObject) => {
this.gameStateObject = response.gameState;
@ -329,8 +327,6 @@ export default class Home extends Vue {
this.diceCount = this.lastTurn?.diceCount.toString() ?? this.diceCount;
this.dieValue = this.lastTurn?.dieValue ?? this.dieValue;
this.clearGameTimer();
console.log(this.gameStateObject);
}
});
}