GameData constructor

GameData(
  1. String id,
  2. dynamic lightPlayer,
  3. dynamic darkPlayer,
  4. String board,
  5. dynamic moves,
  6. int tInitial,
  7. int tIncrement,
  8. int tLightTimer,
  9. int tDarkTimer,
  10. String gameType,
  11. String createdAt,
  12. String updatedAt
)

Implementation

GameData(
    this.id,
    var lightPlayer,
    var darkPlayer,
    this.board,
    var moves,
    this.tInitial,
    this.tIncrement,
    this.tLightTimer,
    this.tDarkTimer,
    this.gameType,
    this.createdAt,
    this.updatedAt) {
  for (var i in moves) {
    this.moves.add(i);
  }
  this.lightPlayer = lightPlayer ?? "AI";
  this.darkPlayer = darkPlayer ?? "AI";
  winner = "";
  endState = "";
}