コード例 #1
0
        public static void OnGameOver(MessageGameOver msg)
        {
            if (msg.Player == null)
            {
                msg.Player = playerControl.GetPlayer(msg.Id);
            }

            playerControl.Remove(msg.Id);
            GameFlowControl.SendGameOver(msg);
        }
コード例 #2
0
        public static void OnNewPlayer(MessageNewPlayer msg)
        {
            Player newPlayer = msg.Player;

            newPlayer.Id = msg.Id;
            bool ret = playerControl.Add(msg.Id, newPlayer);

            if (ret)
            {
                MessageAllPlayers msgAllPlayers = new MessageAllPlayers
                {
                    Header  = "AllPlayers",
                    Id      = msg.Id,
                    Players = playerControl.GetAll(msg.Id)
                };
                GameFlowControl.SendNewPlayer(msg);
                GameFlowControl.SendNewPlayerOK(msg);
                GameFlowControl.SendAllPlayers(msgAllPlayers);
            }
            else
            {
                GameFlowControl.SendNewPlayerFail(msg);
            }
        }
コード例 #3
0
 public static void OnScore(MessageScore msg)
 {
     msg.Name = playerControl.GetNameById(msg.Id);
     playerControl.OnScore(msg.Id, msg.Score);
     GameFlowControl.SendScore(msg);
 }
コード例 #4
0
 public static void OnHand(MessageHand msg)
 {
     msg.Name = playerControl.GetNameById(msg.Id);
     playerControl.OnHand(msg.Id, msg.Hand);
     GameFlowControl.SendHand(msg);
 }
コード例 #5
0
 public static void OnTalk(MessageTalk msg)
 {
     msg.Name = playerControl.GetNameById(msg.Id);
     playerControl.OnTalk(msg.Id, msg.Message);
     GameFlowControl.SendTalk(msg);
 }
コード例 #6
0
 public static void OnMove(MessageMove msg)
 {
     playerControl.OnMove(msg.Id, msg.To);
     GameFlowControl.SendMove(msg);
 }