Пример #1
0
        public void sendChangedMessage()
        {
            {
                var message = new Messages.TurnActionEventMessage();
                message.turnActionEvent = TurnActionEvent.StateChanged;
                message.playerId        = this.Id;
                message.hp   = this.HP;
                message.cost = this.Cost;

                GameServer.Instance.sendMessage(Messages.Type.TURN_ACTION_EVENT, message);
            }

            if (this.HP < 1)
            {
                var message = new Messages.GameEndMessage();
                message.winner = GameServer.Instance.FirstId == this.Id ? GameServer.Instance.SecondId : GameServer.Instance.FirstId;

                GameServer.Instance.sendMessage(Messages.Type.GAME_END, message);
                StateManager.Instance.makeTransition <Server.States.ReadyState>();
            }
        }
 public void onGameEnded(Messages.GameEndMessage message)
 {
     Debug.Log("GameEndMessage");
     onGameEndedNotifier.Report(message);
 }