Пример #1
0
        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
        // 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
 public void ChangeState(MJsonMessageStartKyoku sentMessage)
 {
     gameState = AfterStartKyokuState.GetInstance();
     SetLastActor(sentMessage.oya);
     messageList.Clear();
 }