import GameState from "../../../../GameState" ; import WildlingsAttackGameState from "../WildlingsAttackGameState" ; import Player from "../../../Player" ; import { ClientMessage } from "../../../../../messages/ClientMessage" ; import { ServerMessage } from "../../../../../messages/ServerMessage" ; import Game from "../../../game-data-structure/Game" ; import PlayerMusteringGameState , { PlayerMusteringType , SerializedPlayerMusteringGameState } from "../../mustering-game-state/player-mustering-game-state/PlayerMusteringGameState" ; import House from "../../../game-data-structure/House" ; import IngameGameState from "../../../IngameGameState" ; export default class TheHordeDescendsNightsWatchVictoryGameState extends GameState < WildlingsAttackGameState , PlayerMusteringGameState > { get game ( ) : Game { return this . parentGameState . game ; } get ingame ( ) : IngameGameState { return this . parentGameState . parentGameState . ingame ; } firstStart ( ) { this . ingame . log ( { type : "the-horde-descends-highest-muster" , house : this . parentGameState . highestBidder . id } ) ; this . setChildGameState ( new PlayerMusteringGameState ( this ) ) . firstStart ( this . parentGameState . highestBidder , PlayerMusteringType . THE_HORDE_DESCENDS_WILDLING_CARD ) ; } onPlayerMusteringEnd ( _house ) { this . parentGameState . onWildlingCardExecuteEnd ( ) ; } onPlayerMessage ( player , message ) { this . childGameState . onPlayerMessage ( player , message ) ; } onServerMessage ( _message ) { } serializeToClient ( admin , player ) { return { type : "the-horde-descends-nights-watch-victory" , childGameState : this . childGameState . serializeToClient ( admin , player ) } ; } static deserializeFromServer ( parent , data ) { const mammothRiders = new TheHordeDescendsNightsWatchVictoryGameState ( parent ) ; mammothRiders . childGameState = mammothRiders . deserializeChildGameState ( data . childGameState ) ; return mammothRiders ; } deserializeChildGameState ( data ) { return PlayerMusteringGameState . deserializeFromServer ( this , data ) ; } } export interface SerializedTheHordeDescendsNightsWatchVictoryGameState { type : "the-horde-descends-nights-watch-victory" ; childGameState : SerializedPlayerMusteringGameState ; }