Exemple #1
0
        public void GameTurn(string message)
        {
            //TTTPacket packet = new Gson().FromJson(message, typeof(TTTPacket));
            TTTPacket packet = TTTPacket.DecodeJson(message);

            if (!init)
            {
                Init(packet);
                init = true;
            }
            else
            {
                if (packet.GameResult != null)
                {
                    init = false;
                    RefreshGameField(packet);
                    string str = packet.GameResult;
                    FragmentManagerXO.activity.ExecuteOnUi(() => MessageBox(str, "Game over"));
                }
                else
                {
                    RefreshGameField(packet);
                }
            }
        }
        public void GameTurn(string message)
        {
            TTTPacket packet = TTTPacket.DecodeJson(message);

            if (!init)
            {
                Init(packet);
                init = true;
            }
            else
            {
                if (packet.GameResult != null)
                {
                    init = false;
                    RefreshGameField(packet);
                    string str = packet.GameResult;
                    FragmentManagerXO.activity.ExecuteOnUi(() => MessageBox(str,
                                                                            Resources.GetString(Resource.String.messagebox_game_over_header)));
                }
                else
                {
                    RefreshGameField(packet);
                }
            }
        }