private void SubmitTurnCallBack(SubmitTurnResponse response) { var previous = CurrentGame.Copy(); CurrentGame.Update(response.Match); OnMatchUpdated(CurrentGame, previous); }
private void GetMatchCallBack(GetMatchResponse response) { var previous = CurrentGame.Copy(); CurrentGame.Update(response.Match); OnMatchUpdated(CurrentGame, previous); }
private void StartMatchCallBack(StartMatchResponse response) { UnityEngine.Debug.Log("New Game Created On Server"); var previous = CurrentGame.Copy(); CurrentGame.Update(response.Match); OnMatchUpdated(CurrentGame, previous); }
public void UpdateCurrentGame(Game game) { game.SetPlayers(); if (game.UpdatedActions == GAME_UPDATE.UserQuit && !IsUserInGame(game)) { CurrentGame = new Game(); IsInGame = false; CurrentGameUpdated.Invoke(); return; } if (CurrentGame.CID == string.Empty) { CurrentGame = game; } else { if (CurrentGame.GID == game.GID) { CurrentGame.Copy(game); } else { CurrentGame = game; } } SetPlayer(); SetTeam(); IsInGame = CurrentGame.CID != string.Empty; CurrentGameUpdated.Invoke(); }