Example #1
0
    private void SubmitTurnCallBack(SubmitTurnResponse response)
    {
        var previous = CurrentGame.Copy();

        CurrentGame.Update(response.Match);
        OnMatchUpdated(CurrentGame, previous);
    }
Example #2
0
    private void GetMatchCallBack(GetMatchResponse response)
    {
        var previous = CurrentGame.Copy();

        CurrentGame.Update(response.Match);
        OnMatchUpdated(CurrentGame, previous);
    }
Example #3
0
    private void StartMatchCallBack(StartMatchResponse response)
    {
        UnityEngine.Debug.Log("New Game Created On Server");

        var previous = CurrentGame.Copy();

        CurrentGame.Update(response.Match);

        OnMatchUpdated(CurrentGame, previous);
    }
Example #4
0
        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();
        }