Can't quite tell what's changed

This commit is contained in:
Daniel Ledda
2020-05-24 11:46:17 +02:00
parent d99d7cbfec
commit f08105c39f
20 changed files with 144 additions and 137 deletions

View File

@@ -1,7 +1,8 @@
import React, {ReactElement, ReactNode, useContext} from "react";
import PlayerScoreCard, {CellLocation, PlayerScoreCardJSONRepresentation} from "../Classes/PlayerScoreCard";
import {BlockDef, GameSchema, getGameSchemaById} from "../static/rulesets";
import {formatUnicorn, LocaleContext} from "../static/strings";
import {formatUnicorn} from "../static/strings";
import LocaleContext from "../LocaleContext";
import {CellFlag} from "../static/enums";
import {ScoreCellValue} from "../Classes/ScoreCell";
import {CaretakerSet} from "../Classes/Caretaker";
@@ -131,11 +132,14 @@ class KadiBoard extends React.Component<KadiBoardProps, KadiBoardState> {
}
private getJSONRepresentationForBoard(): string {
const JSONRepresentation: PlayerScoreCardJSONRepresentation[] = [];
const JSONScoreCards: PlayerScoreCardJSONRepresentation[] = [];
for (const playerId in this.state.scoreSheet) {
JSONRepresentation.push(this.state.scoreSheet[playerId].getJSONRepresentation());
JSONScoreCards.push(this.state.scoreSheet[playerId].getJSONRepresentation());
}
return JSON.stringify(JSONRepresentation);
return JSON.stringify({
gameType: this.gameSchema.id,
results: JSONScoreCards
});
}
private canSave(): boolean {