Ejemplo n.º 1
0
        public void reset()
        {
            this.setStatus(RoomStatusByDdz.GAME_WAIT_START);

            this._matchResult = MATCH_RESULT.EMPTY;

            //椅子上也许还有人哦
            //因此只还原ready
            setReadyForAllChair(false);

            setReadyAddForAllChair("");         

            //红方和黑方,如果人未离开,不用改

            this.difen = "";
            this.bomb = 0; this.leaveBomb = 0; this.leaveUserId = "";
            this.dizhu = "";
            this.nongming = "";
            this.mingpai = "";
            this.turn = "";

            //棋盘 reset
            this._board = new PaiBoardByDdz();

            //棋子移动 reset
            this._record = new RoundModelByDdz(ROUND_TYPE.JIAO_FEN);

            //回合信息 reset
            this._round = new List<RoundModelByDdz>();

            _isWaitReconnection = false;
            _curWaitReconnectionTime = 0;

            this.setWaitReconnection(null);
            //_waitReconnectionUser = null;
        }
Ejemplo n.º 2
0
        public RoomModelByDdz(int id, IRuleModel rule, int tab, string gridXml)
        {
            
            this._id = id;

            this._tab = tab;

            if ("" == gridXml)
            {
                this._name = string.Empty;
            }
            else
            {
                XmlDocument gridDoc = new XmlDocument();
                gridDoc.LoadXml(gridXml);

                this._name = gridDoc.DocumentElement.Attributes["name"].Value;

            }

            this.setStatus(RoomStatusByDdz.GAME_WAIT_START);

            this._matchResult = MATCH_RESULT.EMPTY;

            this._chair = new List<IChairModel>();

            for (int i = 1; i <= rule.getChairCount(); i++)
            {
                this._chair.Add(ChairModelFactory.Create(i, rule));

            }//end for

            //red = "";
            //black = "";

            this.difen = "";
            this.bomb = 0; this.leaveBomb = 0; this.leaveUserId = "";
            this.dizhu = "";
            this.nongming = "";
            this.mingpai = "";
            this.turn = "";

            this._board = new PaiBoardByDdz();
            this._record = new RoundModelByDdz(ROUND_TYPE.JIAO_FEN);
            this._round = new List<RoundModelByDdz>();

            _runAwayMultiG = 1;

            _isWaitReconnection = false;
            _curWaitReconnectionTime = 0;

            _waitReconnectionUser = null;

        }