コード例 #1
0
 public void ClearSlot(MatchSlot slot)
 {
     slot.UserId = -1;
     slot.Status = MultiSlotStatus.Open;
     slot.Team   = MultiSlotTeam.NoTeam;
     slot.Mods   = Mod.None;
 }
コード例 #2
0
 public void SetSlot(MatchSlot firstSlot, MatchSlot secondSlot)
 {
     firstSlot.UserId = secondSlot.UserId;
     firstSlot.Status = secondSlot.Status;
     firstSlot.Team   = secondSlot.Team;
     firstSlot.Mods   = secondSlot.Mods;
 }
コード例 #3
0
        public void LockSlot(MatchSlot slot)
        {
            if (slot.UserId != -1)
            {
                Leave(slot.UserId);
            }
            slot.Mods = Mod.None;

            slot.Status = slot.Status != MultiSlotStatus.Locked
                ? MultiSlotStatus.Locked
                : MultiSlotStatus.Open;

            slot.Team = MultiSlotTeam.NoTeam;
        }
コード例 #4
0
        public void SetSlot(int slotId, MatchSlot slot)
        {
            if (slotId > MaxPlayers)
            {
                throw new ArgumentOutOfRangeException();
            }

            var firstSlot = Slots[slotId];

            firstSlot.UserId = slot.UserId;
            firstSlot.Status = slot.Status;
            firstSlot.Team   = slot.Team;
            firstSlot.Mods   = slot.Mods;
        }
コード例 #5
0
        public void SetMods(Mod mods, MatchSlot slot)
        {
            if (slot.IsHost(this) && SpecialModes == MatchSpecialModes.Freemods)
            {
                slot.Mods = FixMods(mods);
            }
            else if (SpecialModes == MatchSpecialModes.Freemods)
            {
                slot.Mods = mods;
            }
            else if (slot.IsHost(this) && SpecialModes == MatchSpecialModes.Normal)
            {
                foreach (var s in Slots)
                {
                    slot.Mods = Mod.None;
                }

                ActiveMods = mods;
            }
        }
コード例 #6
0
        public Match()
        {
            Channel = new Channel
            {
                Name  = "#multiplayer",
                Topic = "Even more osu! default channels!",
            };

            for (var i = 0; i < MaxPlayers; i++)
            {
                Slots[i] = new MatchSlot
                {
                    // ReSharper disable once ConditionalTernaryEqualBranch
                    Status = i > 6 ? MultiSlotStatus.Locked : MultiSlotStatus.Locked,
                    Mods   = 0,
                    Team   = MultiSlotTeam.NoTeam,
                    UserId = -1,
                }
            }
            ;
        }