Exemplo n.º 1
0
 public void WithGender(EGenderType genderType)
 {
     if (genderType.GetValue().IsNotZero())
     {
         Query = Query.Where(customer => customer.Gender == genderType);
     }
 }
Exemplo n.º 2
0
        /**
         * Immutable person
         *
         * @param builder
         */
        private Person(Builder builder)
        {
            _code    = builder._code;
            _message = builder._message;
            _uuid    = builder._uuid;

            _firstname         = builder._firstname;
            _middelname        = builder._middelname;
            _lastname          = builder._lastname;
            _callname          = builder._callname;
            _nameForAddressing = builder._nameForAddressing;

            _gender     = builder._gender;
            _birthdate  = builder._birthdate;
            _birthplace = builder._birthplace;
            _birthRegisteringAuthority = builder._birthRegisteringAuthority;

            _registerInformation = builder._registerInformation;

            _address      = builder._address;
            _otherAddress = builder._otherAddress;
            _movingDate   = builder._movingDate;
            // Now name and address have been set
            _postalLabel = new util.Converters().ToPostalLabel(this);

            _contact             = builder._contact;
            _nextOfKinContact    = builder._nextOfKinContact;
            _effect              = builder._effect;
            _relations           = builder._relations;
            _tilstand            = builder._tilstand;
            _tidspunkt           = builder._tidspunkt;
            _relationsWithPerson = builder._relationsWithPerson;
        }
Exemplo n.º 3
0
    public void ParseModelJson()
    {
        JSONObject j = requestDataFromWeb.RequestCharacterData();

        foreach (JSONObject temp in j.list)
        {
            //公有属性
            int             id         = (int)temp["ID"].n;
            EModelName      name       = (EModelName)System.Enum.Parse(typeof(EModelName), temp["ModelName"].str);
            int             level      = (int)temp["Level"].n;
            EBaseModelType  baseType   = (EBaseModelType)System.Enum.Parse(typeof(EBaseModelType), temp["BaseType"].str);//基础类型(玩家,敌人,npc)
            ERaceType       race       = (ERaceType)System.Enum.Parse(typeof(ERaceType), temp["Race"].str);
            EProfessionType profession = (EProfessionType)System.Enum.Parse(typeof(EProfessionType), temp["Profession"].str);
            EGenderType     gender     = (EGenderType)System.Enum.Parse(typeof(EGenderType), temp["Gender"].str);

            BaseModel baseModel = null;

            switch (baseType)
            {
            case EBaseModelType.eCharacter:
                int   hp              = (int)temp["HP"].n;
                int   hpRecoverRate   = (int)temp["HpRecoverRate"].n;
                int   mp              = (int)temp["MP"].n;
                int   mpRecoverRate   = (int)temp["MpRecoverRate"].n;
                int   levelExp        = (int)temp["LevelExp"].n;
                int   exp             = (int)temp["Exp"].n;
                float expPercentRate  = (float)temp["ExpPercentRate"].n;
                int   levelUpperLimit = (int)temp["LevelUpperLimit"].n;
                int   intelligence    = (int)temp["Intelligence"].n;
                int   strength        = (int)temp["Strength"].n;
                int   agility         = (int)temp["Agility"].n;
                int   stamina         = (int)temp["Stamina"].n;
                int   energy          = (int)temp["Energy"].n;
                float missRate        = (float)temp["MissRate"].n;
                int   missValue       = (int)temp["MissValue"].n;
                float criRate         = (float)temp["CriRate"].n;
                int   criValue        = (int)temp["CriValue"].n;
                int   attackDamage    = (int)temp["AttackDamage"].n;
                int   physicDenfence  = (int)temp["PhysicDenfence"].n;
                int   magicDenfence   = (int)temp["MagicDenfence"].n;

                baseModel = new Character(id, name, level, baseType, race, profession, gender, hp, hpRecoverRate, mp, mpRecoverRate, exp, levelExp, expPercentRate, levelUpperLimit,
                                          intelligence, strength, agility, stamina, energy, missRate, missValue, attackDamage, criRate, criValue, physicDenfence, magicDenfence);
                break;

            case EBaseModelType.eNPC:
                break;

            case EBaseModelType.eEnemy:
                break;

            default:
                break;
            }
            characterModelList.Add(baseModel);
        }
    }
        public ValidationFailure ReferencesValidate(Customer customer, ValidationContext <Customer> context)
        {
            var genderType = new EGenderType().ConvertToCollection().FirstOrDefault(enumerator => enumerator.Value == customer.Gender.GetValue());

            if (genderType.IsNull())
            {
                ExceptionExtensions.ThrowCustomConflictException(EErrorCode.InvalidIdentifier, "El tipo de genero no existe");
            }

            return(null);
        }
        public ValidationFailure ReferencesValidate(User user, ValidationContext <User> context)
        {
            var genderType = new EGenderType().ConvertToCollection().FirstOrDefault(genderTp => genderTp.Value == user.GenderType.GetValue());

            if (genderType.IsNull())
            {
                return(new ValidationFailure("User", "El tipo de genero no existe"));
            }

            return(null);
        }
 public BaseModel(int id, EModelName name, int level, EBaseModelType baseType, ERaceType race, EProfessionType profession, EGenderType gender)
 {
     this.ID        = id;
     this.ModelName = name;
     this.Level     = level;
     //this.Sprite = sprite;
     this.BaseType   = baseType;
     this.Race       = race;
     this.Profession = profession;
     this.Gender     = gender;
 }
Exemplo n.º 7
0
 public Builder gender(String newGender)
 {
     _gender = (EGenderType)Enum.Parse(typeof(EGenderType), newGender, true);
     return(this);
 }
Exemplo n.º 8
0
 public Enemy(int id, EModelName name, int level, EBaseModelType baseType, ERaceType race, EProfessionType profession, EGenderType gender, EEnemy enemyType, int expDrop, int hp, int damage) :
     base(id, name, level, baseType, race, profession, gender)
 {
     this.EnemyType = enemyType;
     this.ExpDrop   = expDrop;
     this.HP        = hp;
     this.Damage    = damage;
 }
Exemplo n.º 9
0
 public NPC(int id, EModelName name, int level, EBaseModelType baseType, ERaceType race, EProfessionType profession, EGenderType gender, ENPCType npcType) : base(id, name, level, baseType, race, profession, gender)
 {
     this.NpcType = npcType;
 }
Exemplo n.º 10
0
 public Character(int id, EModelName name, int level, EBaseModelType baseType, ERaceType race, EProfessionType profession, EGenderType gender, int hp, int hpRR, int mp, int mpRR, int exp, int levelExp, float ExpPR, int LevelUL,
                  int intelligence, int strength, int agility, int stamina, int energy, float missRate, int missValue, int attack, float criRate, int criValue, int pDenfence, int mDenfence) : base(id, name, level, baseType, race, profession, gender)
 {
     this.HP              = hp;
     this.HpRecoverRate   = hpRR;
     this.MP              = mp;
     this.MpRecoverRate   = mpRR;
     this.Exp             = exp;
     this.LevelExp        = levelExp;
     this.ExpPercentRate  = ExpPR;
     this.LevelUpperLimit = LevelUL;
     this.Intelligence    = intelligence;
     this.Strength        = strength;
     this.Agility         = agility;
     this.Stamina         = stamina;
     this.Energy          = energy;
     this.MissRate        = missRate;
     this.AttackDamage    = attack;
     this.PhysicDenfence  = pDenfence;
     this.MagicDenfence   = mDenfence;
     this.CriValue        = criValue;
     this.MissValue       = missValue;
     this.CritRate        = criRate;
 }