Exemplo n.º 1
0
        public void Clear()
        {
            id    = 0;
            sname = null;
            fname = null;

            sex    = null;
            status = null;

            phone = null;
            email = default;


            sexStatus = SexStatus.None;
            country   = null;
            premium   = default;
            likes.Clear();

            interests.Clear();
            joined = 0;
            city   = null;
            birth  = 0;

            Fields = UpdatedFields.None;
        }
Exemplo n.º 2
0
        public IEnumerable <uint> GetListBy(SexStatus sexStatus, PhoneCode phoneCode, UintMultiUnionList union)
        {
            var codeOffset = PhoneCodeOffset(phoneCode.GetSpan().Slice(1));

            switch (sexStatus & SexStatus.AllSex)
            {
            case SexStatus.Male:
            {
                Free.MenWithPhoneCode(codeOffset, union);
                NotFree.MenWithPhoneCode(codeOffset, union);
                Complex.MenWithPhoneCode(codeOffset, union);
                return(union);
            }

            case SexStatus.Female:
            {
                Free.WomenWithPhoneCode(codeOffset, union);
                NotFree.WomenWithPhoneCode(codeOffset, union);
                Complex.WomenWithPhoneCode(codeOffset, union);
                return(union);
            }

            default:
            {
                Free.MenWithPhoneCode(codeOffset, union);
                NotFree.MenWithPhoneCode(codeOffset, union);
                Complex.MenWithPhoneCode(codeOffset, union);
                Free.WomenWithPhoneCode(codeOffset, union);
                NotFree.WomenWithPhoneCode(codeOffset, union);
                Complex.WomenWithPhoneCode(codeOffset, union);
                return(union);
            }
            }
        }
Exemplo n.º 3
0
 public GroupKey(SexStatus sexStatus, ushort interestIndex, ushort countryIndex, ushort cityIndex)
 {
     _dummy        = 0; //will be overwritten by the further
     _cityCountry  = 0;
     SexStatus     = sexStatus;
     InterestIndex = interestIndex;
     CountryIndex  = countryIndex;
     CityIndex     = cityIndex;
 }
Exemplo n.º 4
0
        public bool AddEqStatus(string value)
        {
            SexStatus status = Statuses.GetStatus(value);

            if (status == SexStatus.None)
            {
                return(false);
            }

            Fields.Add(Serializer.Fields.Status);
            AddSexStatusFilter(status, FilterTypes.status_eq);

            return(true);
        }
Exemplo n.º 5
0
        public int this[SexStatus index]
        {
            get
            {
                switch (index)
                {
                case SexStatus.None:
                    return(TotalAll);

                case SexStatus.Male:
                    return(TotalMen);

                case SexStatus.Female:
                    return(TotalWomen);

                case SexStatus.Free:
                    return(TotalFree);

                case SexStatus.NotFree:
                    return(TotalNotFree);

                case SexStatus.Complex:
                    return(TotalComplex);

                case SexStatus.Male | SexStatus.Free:
                    return(Free.MenCount);

                case SexStatus.Male | SexStatus.NotFree:
                    return(NotFree.MenCount);

                case SexStatus.Male | SexStatus.Complex:
                    return(Complex.MenCount);

                case SexStatus.Female | SexStatus.Free:
                    return(Free.WomenCount);

                case SexStatus.Female | SexStatus.NotFree:
                    return(NotFree.WomenCount);

                case SexStatus.Female | SexStatus.Complex:
                    return(Complex.WomenCount);
                }

                return(0);
            }
        }
Exemplo n.º 6
0
        public int Interests(ushort interest, SexStatus sexStatus, ushort joinedYear, ushort birthYear)
        {
            switch (sexStatus)
            {
            case SexStatus.Male:
                return(Free.InterestMen(interest, joinedYear, birthYear) + NotFree.InterestMen(interest, joinedYear, birthYear) + Complex.InterestMen(interest, joinedYear, birthYear));

            case SexStatus.Female:
                return(Free.InterestWomen(interest, joinedYear, birthYear) + NotFree.InterestWomen(interest, joinedYear, birthYear) + Complex.InterestWomen(interest, joinedYear, birthYear));

            case SexStatus.Free:
                return(Free.InterestMen(interest, joinedYear, birthYear) + Free.InterestWomen(interest, joinedYear, birthYear));

            case SexStatus.NotFree:
                return(NotFree.InterestMen(interest, joinedYear, birthYear) + NotFree.InterestWomen(interest, joinedYear, birthYear));

            case SexStatus.Complex:
                return(Complex.InterestMen(interest, joinedYear, birthYear) + Complex.InterestWomen(interest, joinedYear, birthYear));


            case SexStatus.Male | SexStatus.Free:
                return(Free.InterestMen(interest, joinedYear, birthYear));

            case SexStatus.Male | SexStatus.NotFree:
                return(NotFree.InterestMen(interest, joinedYear, birthYear));

            case SexStatus.Male | SexStatus.Complex:
                return(Complex.InterestMen(interest, joinedYear, birthYear));


            case SexStatus.Female | SexStatus.Free:
                return(Free.InterestWomen(interest, joinedYear, birthYear));

            case SexStatus.Female | SexStatus.NotFree:
                return(NotFree.InterestWomen(interest, joinedYear, birthYear));

            case SexStatus.Female | SexStatus.Complex:
                return(Complex.InterestWomen(interest, joinedYear, birthYear));

            case SexStatus.None:
                return(Free.InterestMen(interest, joinedYear, birthYear) + NotFree.InterestMen(interest, joinedYear, birthYear) + Complex.InterestMen(interest, joinedYear, birthYear)
                       + Free.InterestWomen(interest, joinedYear, birthYear) + NotFree.InterestWomen(interest, joinedYear, birthYear) + Complex.InterestWomen(interest, joinedYear, birthYear));
            }
            return(0);
        }
Exemplo n.º 7
0
        public int Born(ushort birthYear, SexStatus sexStatus)
        {
            switch (sexStatus)
            {
            case SexStatus.Male:
                return(Free.BornMen(birthYear) + NotFree.BornMen(birthYear) + Complex.BornMen(birthYear));

            case SexStatus.Female:
                return(Free.BornWomen(birthYear) + NotFree.BornWomen(birthYear) + Complex.BornWomen(birthYear));

            case SexStatus.Free:
                return(Free.BornMen(birthYear) + Free.BornWomen(birthYear));

            case SexStatus.NotFree:
                return(NotFree.BornMen(birthYear) + NotFree.BornWomen(birthYear));

            case SexStatus.Complex:
                return(Complex.BornMen(birthYear) + Complex.BornWomen(birthYear));


            case SexStatus.Male | SexStatus.Free:
                return(Free.BornMen(birthYear));

            case SexStatus.Male | SexStatus.NotFree:
                return(NotFree.BornMen(birthYear));

            case SexStatus.Male | SexStatus.Complex:
                return(Complex.BornMen(birthYear));


            case SexStatus.Female | SexStatus.Free:
                return(Free.BornWomen(birthYear));

            case SexStatus.Female | SexStatus.NotFree:
                return(NotFree.BornWomen(birthYear));

            case SexStatus.Female | SexStatus.Complex:
                return(Complex.BornWomen(birthYear));

            case SexStatus.None:
                return(Free.BornMen(birthYear) + NotFree.BornMen(birthYear) + Complex.BornMen(birthYear)
                       + Free.BornWomen(birthYear) + NotFree.BornWomen(birthYear) + Complex.BornWomen(birthYear));
            }
            return(0);
        }
Exemplo n.º 8
0
        public int Joined(ushort joinedYear, SexStatus sexStatus)
        {
            switch (sexStatus)
            {
            case SexStatus.Male:
                return(Free.JoinedMen(joinedYear) + NotFree.JoinedMen(joinedYear) + Complex.JoinedMen(joinedYear));

            case SexStatus.Female:
                return(Free.JoinedWomen(joinedYear) + NotFree.JoinedWomen(joinedYear) + Complex.JoinedWomen(joinedYear));

            case SexStatus.Free:
                return(Free.JoinedMen(joinedYear) + Free.JoinedWomen(joinedYear));

            case SexStatus.NotFree:
                return(NotFree.JoinedMen(joinedYear) + NotFree.JoinedWomen(joinedYear));

            case SexStatus.Complex:
                return(Complex.JoinedMen(joinedYear) + Complex.JoinedWomen(joinedYear));


            case SexStatus.Male | SexStatus.Free:
                return(Free.JoinedMen(joinedYear));

            case SexStatus.Male | SexStatus.NotFree:
                return(NotFree.JoinedMen(joinedYear));

            case SexStatus.Male | SexStatus.Complex:
                return(Complex.JoinedMen(joinedYear));


            case SexStatus.Female | SexStatus.Free:
                return(Free.JoinedWomen(joinedYear));

            case SexStatus.Female | SexStatus.NotFree:
                return(NotFree.JoinedWomen(joinedYear));

            case SexStatus.Female | SexStatus.Complex:
                return(Complex.JoinedWomen(joinedYear));

            case SexStatus.None:
                return(Free.JoinedMen(joinedYear) + NotFree.JoinedMen(joinedYear) + Complex.JoinedMen(joinedYear)
                       + Free.JoinedWomen(joinedYear) + NotFree.JoinedWomen(joinedYear) + Complex.JoinedWomen(joinedYear));
            }
            return(0);
        }
Exemplo n.º 9
0
 public virtual void Reset()
 {
     //Do not clear other fields as they will be ignored actually
     Fields.Clear();
     cities?.Clear();
     likes?.Clear();
     fnamesIndexes?.Clear();
     WillYieldZeroResults = false;
     _filters             = FilterTypes.empty;
     _sexStatus           = SexStatus.None;
     cityIndex            = 0;
     countryIndex         = 0;
     joinedTo             = 0;
     joinedFrom           = 0;
     birth = 0;
     _union.Clear();
     _intersect.Clear();
 }
Exemplo n.º 10
0
 public static bool IsFree(this SexStatus self) => self.HasFlags(SexStatus.Free);
Exemplo n.º 11
0
 public static bool IsFemale(this SexStatus self) => self.HasFlags(SexStatus.Female);
Exemplo n.º 12
0
 private static SexGroup GetSexGroupByCity(ushort cityIndex, SexStatus sexStatus)
 {
     return(GetSexGroup(ByCities, cityIndex, sexStatus));
 }
Exemplo n.º 13
0
        public IEnumerable <uint> GetListBy(SexStatus sexStatus, UintMultiUnionList union)
        {
            switch (sexStatus)
            {
            case SexStatus.Male | SexStatus.Free:
                return(Free.Men.All);

            case SexStatus.Male | SexStatus.NotFree:
                return(NotFree.Men.All);

            case SexStatus.Male | SexStatus.Complex:
                return(Complex.Men.All);

            case SexStatus.Female | SexStatus.Free:
                return(Free.Women.All);

            case SexStatus.Female | SexStatus.NotFree:
                return(NotFree.Women.All);

            case SexStatus.Female | SexStatus.Complex:
                return(Complex.Women.All);

            case SexStatus.Male:
                return(union.Add(Free.Men.All).Add(NotFree.Men.All).Add(Complex.Men.All));

            case SexStatus.Female:
                return(union.Add(Free.Women.All).Add(NotFree.Women.All).Add(Complex.Women.All));

            case SexStatus.Male | SexStatus.Free | SexStatus.NotFree:
                return(union.Add(Free.Men.All).Add(NotFree.Men.All));

            case SexStatus.Female | SexStatus.Free | SexStatus.NotFree:
                return(union.Add(Free.Women.All).Add(NotFree.Women.All));

            case SexStatus.Male | SexStatus.Free | SexStatus.Complex:
                return(union.Add(Free.Men.All).Add(Complex.Men.All));

            case SexStatus.Female | SexStatus.Free | SexStatus.Complex:
                return(union.Add(Free.Women.All).Add(Complex.Women.All));

            case SexStatus.Free | SexStatus.NotFree:
                return(union.Add(Free.Men.All).Add(Free.Women.All).Add(NotFree.Men.All).Add(NotFree.Women.All));

            case SexStatus.Free | SexStatus.Complex:
                return(union.Add(Free.Men.All).Add(Free.Women.All).Add(Complex.Men.All).Add(Complex.Women.All));

            case SexStatus.Complex | SexStatus.NotFree:
                return(union.Add(Complex.Men.All).Add(Complex.Women.All).Add(NotFree.Men.All).Add(NotFree.Women.All));

            case SexStatus.Free:
                return(union.Add(Free.Men.All).Add(Free.Women.All));

            case SexStatus.NotFree:
                return(union.Add(NotFree.Men.All).Add(NotFree.Women.All));

            case SexStatus.Complex:
                return(union.Add(Complex.Men.All).Add(Complex.Women.All));


            case SexStatus.Male | SexStatus.NotFree | SexStatus.Complex:
                return(union.Add(NotFree.Men.All).Add(Complex.Men.All));

            case SexStatus.Female | SexStatus.NotFree | SexStatus.Complex:
                return(union.Add(NotFree.Women.All).Add(Complex.Women.All));

            case SexStatus.Male | SexStatus.AllStatus:
                return(union.Add(Free.Men.All).Add(NotFree.Men.All).Add(Complex.Men.All));

            case SexStatus.Female | SexStatus.AllStatus:
                return(union.Add(Free.Women.All).Add(NotFree.Women.All).Add(Complex.Women.All));
            }
            throw new InvalidOperationException(sexStatus.ToString());
        }
Exemplo n.º 14
0
 private void AddSexStatusFilter(SexStatus sexStatus, FilterTypes type)
 {
     _sexStatus |= sexStatus;
     _filters   |= type;
 }
Exemplo n.º 15
0
        public static string ToNullableStatusString(this SexStatus sexStatus)
        {
            var index = (int)(sexStatus & SexStatus.AllStatus);

            return(strings[index]);
        }
Exemplo n.º 16
0
 public static bool HasFlags(this SexStatus self, SexStatus value) => (self & value) == value;
Exemplo n.º 17
0
 public static bool IsComplex(this SexStatus self) => self.HasFlags(SexStatus.NotFree);
Exemplo n.º 18
0
 private static SexGroup GetSexGroupByCountry(ushort countryIndex, SexStatus sexStatus)
 {
     return(GetSexGroup(ByCountries, countryIndex, sexStatus));
 }
Exemplo n.º 19
0
        private SexStatus GetSexStatus()
        {
            SexStatus result = Statuses.GetStatus(status);

            return(result | (sex == "m" ? SexStatus.Male : SexStatus.Female));
        }
Exemplo n.º 20
0
 private static SexGroup GetSexGroup(StatusGroup[] statusGroups, ushort index, SexStatus sexStatus)
 {
     ref StatusGroup statusGroup = ref statusGroups[index];
Exemplo n.º 21
0
 public static SexStatus Set(this SexStatus self, SexStatus value) => self | value;