private static void RemoveByCity(Account account) { SexGroup group = GetSexGroupByCity(account.cityIndex, account.SexStatus); group.Remove(account); if (account.cityIndex > 0) { SexGroup notNullGroup = GetSexGroupByCity(StringIndexer.MaxCityCount, account.SexStatus); notNullGroup.Remove(account); } }
private static void RemoveByCountry(Account account) { checked { SexGroup group = GetSexGroupByCountry(account.countryIndex, account.SexStatus); group.Remove(account); if (account.SexStatus.IsMale()) { TotalMen--; _joinedBySex[account.GetJoinedOffset()]--; _bornBySex[account.GetBirthOffset()]--; } else { TotalWomen--; _joinedBySex[account.GetJoinedOffset() + 10]--; _bornBySex[account.GetBirthOffset() + 60]--; } checked { switch (account.SexStatus & SexStatus.AllStatus) { case SexStatus.Free: TotalFree--; _joinedByStatus[account.GetJoinedOffset()]--; _bornByStatus[account.GetBirthOffset()]--; break; case SexStatus.NotFree: TotalNotFree--; _joinedByStatus[account.GetJoinedOffset() + 10]--; _bornByStatus[account.GetBirthOffset() + 60]--; break; case SexStatus.Complex: TotalComplex--; _joinedByStatus[account.GetJoinedOffset() + 20]--; _bornByStatus[account.GetBirthOffset() + 120]--; break; } } } if (account.countryIndex > 0) { SexGroup notNullGroup = GetSexGroupByCountry(StringIndexer.MaxCountryCount, account.SexStatus); notNullGroup.Remove(account); } }
public StatusGroup(int size) { Free = new SexGroup(size); NotFree = new SexGroup(size); Complex = new SexGroup(size); }