Пример #1
0
        public SLOT changeTeam(Account player,int team)
        {
            SLOT roomSlotByPlayer = this.getRoomSlotByPlayer(player);

            int[] array = (team == 0) ? this.RED_TEAM : this.BLUE_TEAM;
            SLOT  result;

            for (int i = 0; i < array.Length; i++)
            {
                int  num  = array[i];
                SLOT sLOT = this._slots[num];
                bool flag = player.Equals(sLOT.getPlayer()) || sLOT.getState() == SLOT_STATE.SLOT_STATE_NORMAL;
                if (flag)
                {
                    roomSlotByPlayer.setPlayer(null);
                    roomSlotByPlayer.setState(SLOT_STATE.SLOT_STATE_NORMAL);
                    sLOT.setPlayer(player);
                    sLOT.setState(SLOT_STATE.SLOT_STATE_NORMAL);
                    result = sLOT;
                    return(result);
                }
            }
            result = null;
            return(result);
        }
Пример #2
0
        public int getSlotBattle()
        {
            int num = 0;

            SLOT[] slots = this._slots;
            for (int i = 0; i < slots.Length; i++)
            {
                SLOT sLOT = slots[i];
                bool flag = sLOT.getPlayer().hasSlotState(SLOT_STATE.SLOT_STATE_BATTLE_READY);
                if (flag)
                {
                    num |= 1 << sLOT.getId();
                }
            }
            return(num);
        }
Пример #3
0
        public SLOT getRoomSlotByPlayer(Account player)
        {
            SLOT[] slots = this._slots;
            SLOT   result;

            for (int i = 0; i < slots.Length; i++)
            {
                SLOT sLOT = slots[i];
                bool flag = player.Equals(sLOT.getPlayer());
                if (flag)
                {
                    result = sLOT;
                    return(result);
                }
            }
            result = null;
            return(result);
        }