public void ClearSlot(MatchSlot slot) { slot.UserId = -1; slot.Status = MultiSlotStatus.Open; slot.Team = MultiSlotTeam.NoTeam; slot.Mods = Mod.None; }
public void SetSlot(MatchSlot firstSlot, MatchSlot secondSlot) { firstSlot.UserId = secondSlot.UserId; firstSlot.Status = secondSlot.Status; firstSlot.Team = secondSlot.Team; firstSlot.Mods = secondSlot.Mods; }
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; }
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; }
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; } }
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, } } ; }