コード例 #1
0
ファイル: GameRoom.cs プロジェクト: rick0000/MjModel
        public void ReplaceKyokuInfoForTest(MJsonMessageStartKyoku msg)
        {
            var haipais = msg.tehais;

            var field = new Field(msg.kyoku, msg.honba, msg.kyotaku, msg.oya, msg.bakaze);
            gameModel.field = field;

            gameModel.tehais = haipais.Select(e => new Tehai(e)).ToList();
            gameContext.ChangeState(msg);
            gameModel.SetCurrentActor(msg.oya);

            gameModel.infoForResultList = new List<InfoForResult>()
            {
                new InfoForResult(field.KyokuId, 0, field.OyaPlayerId),
                new InfoForResult(field.KyokuId, 1, field.OyaPlayerId),
                new InfoForResult(field.KyokuId, 2, field.OyaPlayerId),
                new InfoForResult(field.KyokuId, 3, field.OyaPlayerId)
            };

        }
コード例 #2
0
ファイル: GameRoom.cs プロジェクト: rick0000/MjModel
        // hide tsumopai and haipai in messages by follow functions
        public void SendMJsonObject(MJsonMessageStartKyoku jsonmsg)
        {
            // logging
            logger.MjLog(MjsonObjectToString(jsonmsg));

            var opentehais = jsonmsg.tehais;
            var hidetehais = new List<List<string>>() {
                Tehai.UNKNOWN_TEHAI_STRING ,
                Tehai.UNKNOWN_TEHAI_STRING ,
                Tehai.UNKNOWN_TEHAI_STRING ,
                Tehai.UNKNOWN_TEHAI_STRING
            };
            
            for(int i = 0; i < clients.Count; i++)
            {
                var sendMessage = jsonmsg;
                sendMessage.tehais = hidetehais;
                sendMessage.tehais[i] = opentehais[i];
                clients[i].SendMessageToClient(MjsonObjectToString(sendMessage));
                sendMessage.tehais[i] = Tehai.UNKNOWN_TEHAI_STRING;
            }

        }
コード例 #3
0
ファイル: GameContext.cs プロジェクト: rick0000/MjModel
 public void ChangeState(MJsonMessageStartKyoku sentMessage)
 {
     gameState = AfterStartKyokuState.GetInstance();
     SetLastActor(sentMessage.oya);
     messageList.Clear();
 }