protected override GameState CalculateState(GameState state) { _state = (CommonInterfaces.Pacman.GameState)state; GameState nextState = _state.NextState(Inputs); foreach (Player p in nextState.NewDeadPlayers) { _form.Invoke(new UpdateServerLogDelegate(_form.UpdateServerLogTB), $"Player {p.Id} died with {p.Score} coins."); } nextState.NewDeadPlayers.Clear(); return(nextState); }
protected override void DrawGameState(GameState state) { CommonInterfaces.Pacman.GameState pstate = (CommonInterfaces.Pacman.GameState)state; if (_boardControl == null) { InitGamePanel(pstate.Board); InitGhosts(pstate.Ghosts); InitPlayers(pstate.Players); InitCoins(pstate.Coins); InitWalls(pstate.Walls); _cf.Invoke(new AddFormPanelControlDelegate(_cf.AddGamePanelControl), _boardControl.Panel); } else { updateGhosts(pstate.Ghosts); updatePlayers(pstate.Players); updateCoins(pstate.Coins); } }