public bool RemoveInvite(User user) { if (!InviteIds.Remove(user.Id)) { return(false); } Api.OnPlayerUninvitedFromFaction(this, user); return(true); }
public bool AddInvite(User user) { if (!InviteIds.Add(user.Id)) { return(false); } Api.OnPlayerInvitedToFaction(this, user); return(true); }
public bool AddMember(User user) { if (!MemberIds.Add(user.Id)) { return(false); } InviteIds.Remove(user.Id); Api.OnPlayerJoinedFaction(this, user); return(true); }
public FactionInfo Serialize() { return(new FactionInfo { Id = Id, OwnerId = OwnerId, MemberIds = MemberIds.ToArray(), ManagerIds = ManagerIds.ToArray(), InviteIds = InviteIds.ToArray(), TaxRate = TaxRate, TaxChestId = TaxChest?.net?.ID, NextUpkeepPaymentTime = NextUpkeepPaymentTime }); }
public User[] GetAllActiveInvitedUsers() { return(InviteIds.Select(id => Instance.Users.Get(id)).Where(user => user != null).ToArray()); }
public bool HasInvite(string userId) { return(InviteIds.Contains(userId)); }