public void Index(Account account) { if (_all.InsertDescending(account.id)) { var joinedOffset = account.GetJoinedOffset(); var birthOffset = account.GetBirthOffset(); _joined[joinedOffset].InsertDescending(account.id); _birth[birthOffset].InsertDescending(account.id); foreach (var interest in account.InterestIndexes) { _joinedInterests[joinedOffset * MaxInterestCount + interest]++; _birthInterests[birthOffset * MaxInterestCount + interest]++; _interestTotal[interest]++; } if (!account.phone.IsEmpty) { var codeOffset = PhoneCodeOffset(account.phone.Span.Slice(4, 2)); ref HList <uint> byCodes = ref _phoneCode[codeOffset]; if (byCodes == null) { byCodes = new HList <uint>(); } byCodes.InsertDescending(account.id); } }
public LikeeIndexEntry Add(Account liker) { byte men = Men; byte women = Women; byte free = Free; byte notFree = NotFree; byte complex = Complex; if (Likers.InsertDescending(liker.id)) { if (liker.SexStatus.IsMale()) { men += 1; } else { women += 1; } switch (liker.SexStatus & SexStatus.AllStatus) { case SexStatus.Free: free++; break; case SexStatus.NotFree: notFree++; break; case SexStatus.Complex: complex++; break; } } return(new LikeeIndexEntry(Likers, men, women, free, notFree, complex)); }