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 value!: GameRules;
@Prop() private readonly!: boolean; @Prop() private readonly!: boolean;
private get startDicePerPlayer (): number { private get startDicePerPlayer (): number|string {
return this.value.startDicePerPlayer; return this.value.startDicePerPlayer;
} }
private set startDicePerPlayer (b: number) { private set startDicePerPlayer (b: number|string) {
this.value.startDicePerPlayer = b; this.value.startDicePerPlayer = parseInt(b.toString());
this.emitRules(); this.emitRules();
} }

View File

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