Example #1
0
        public override int GetHashCode()
        {
            int prime  = 31;
            int result = 1;

            result = prime * result + Id.BitShiftThenBitOr(prime);
            result = prime * result + Name.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + Gender.GenderToInt().BitShiftThenBitOr(prime);
            result = prime * result + BirthDate.DateToInt().BitShiftThenBitOr(prime);
            result = prime * result + Email.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + Phone.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + ZipCode.BitShiftThenBitOr(prime);
            result = prime * result + Address.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + UserName.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + Password.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + Pin.BitShiftThenBitOr(prime);
            result = prime * result + LoginIP.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + MacAddress.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + StartingDate.DateToInt().BitShiftThenBitOr(prime);
            result = prime * result + Access.AccessToInt().BitShiftThenBitOr(prime);
            result = prime * result + AccountPriority.AccountPriorityToInt().BitShiftThenBitOr(prime);
            result = prime * result + MembershipType.MembershipToInt().BitShiftThenBitOr(prime);
            result = prime * result + Email.StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + BirthDate.ToString().StringToInt().BitShiftThenBitOr(prime);
            result = prime * result + LastLogin.DateToInt().BitShiftThenBitOr(prime);
            result = prime * result + LastLogout.DateToInt().BitShiftThenBitOr(prime);
            result = prime * result + Age.BitShiftThenBitOr(prime);
            return(result);
        }
Example #2
0
        public static int AccountPriorityToInt(this AccountPriority a)
        {
            switch (a)
            {
            case AccountPriority.Admin:         return(0);

            case AccountPriority.GameMaster:    return(1);

            case AccountPriority.Owner:         return(2);

            case AccountPriority.Player:        return(3);

            case AccountPriority.PlayerManager: return(4);
            }
            return(0);
        }
Example #3
0
 public Account(int id, string Name, string UserName, string Email, string Password, int PinCode, AccountPriority Priority, int FoodNegativeAmount, DateTime lastLogin, DateTime lastLogout, App app)
 {
     this.Id                 = id;
     this.Name               = Name;
     this.UserName           = UserName;
     this.Email              = Email;
     this.Password           = Password;
     this.PinCode            = PinCode;
     this.Priority           = Priority;
     this.FoodNegativeAmount = FoodNegativeAmount;
     this.LastLogin          = lastLogin;
     this.LastLogout         = lastLogout;
     this.App                = app;
 }