示例#1
0
            public bool RemoveInvite(User user)
            {
                if (!InviteIds.Remove(user.Id))
                {
                    return(false);
                }

                Api.OnPlayerUninvitedFromFaction(this, user);
                return(true);
            }
示例#2
0
            public bool AddInvite(User user)
            {
                if (!InviteIds.Add(user.Id))
                {
                    return(false);
                }

                Api.OnPlayerInvitedToFaction(this, user);
                return(true);
            }
示例#3
0
            public bool AddMember(User user)
            {
                if (!MemberIds.Add(user.Id))
                {
                    return(false);
                }

                InviteIds.Remove(user.Id);

                Api.OnPlayerJoinedFaction(this, user);
                return(true);
            }
示例#4
0
 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
     });
 }
示例#5
0
 public User[] GetAllActiveInvitedUsers()
 {
     return(InviteIds.Select(id => Instance.Users.Get(id)).Where(user => user != null).ToArray());
 }
示例#6
0
 public bool HasInvite(string userId)
 {
     return(InviteIds.Contains(userId));
 }