Exemplo n.º 1
0
            public override ErrorList Validate()
            {
                var result = new ErrorList();

                result.AddRange(base.Validate());

                if (Language != null)
                {
                    result.AddRange(Language.Validate());
                }
                if (Mode != null)
                {
                    Mode.ForEach(elem => result.AddRange(elem.Validate()));
                }
                if (ProficiencyLevel != null)
                {
                    result.AddRange(ProficiencyLevel.Validate());
                }
                if (Preference != null)
                {
                    result.AddRange(Preference.Validate());
                }

                return(result);
            }
Exemplo n.º 2
0
        public static string ToProficiencyString( ProficiencyLevel p )
        {
            if ( (Int32)p >= ProficiencyNames.Count<string>() )
                return "Unknown";

            return ProficiencyNames[Convert.ToInt32(p)];
        }
Exemplo n.º 3
0
        public static string ToProficiencyString(ProficiencyLevel p)
        {
            if ((Int32)p >= ProficiencyNames.Count <string>())
            {
                return("Unknown");
            }

            return(ProficiencyNames[Convert.ToInt32(p)]);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Loads all proficiency levels ordered by level.
        /// </summary>
        /// <returns>All proficiency levels.</returns>
        public async Task <IEnumerable <ProficiencyLevel> > LoadProficiencyLevelsAsync()
        {
            var command = new SqlCommand("ProficiencyLevels_SelectAll", await GetOpenConnectionAsync());

            command.CommandType = System.Data.CommandType.StoredProcedure;

            List <ProficiencyLevel> proficiencyLevels = new List <ProficiencyLevel>();

            using (SqlDataReader reader = await command.ExecuteReaderAsync())
            {
                while (await reader.ReadAsync())
                {
                    var proficiencyLevel = new ProficiencyLevel();
                    proficiencyLevel.Level = reader.Field <int>("Level");
                    proficiencyLevel.Name  = reader.Field <string>("Name");
                    proficiencyLevel.SecondPersonDescription = reader.Field <string>("SecondPersonDescription");
                    proficiencyLevel.ThirdPersonDescription  = reader.Field <string>("ThirdPersonDescription");
                    proficiencyLevels.Add(proficiencyLevel);
                }
            }
            return(proficiencyLevels);
        }
        public static float GetRatio(ProficiencyLevel lvl)
        {
            switch (lvl)
            {
            case ProficiencyLevel.HALF:
                return(0.5f);

                break;

            case ProficiencyLevel.FULL:
                return(1f);

                break;

            case ProficiencyLevel.DOUBLE:
                return(2f);

                break;

            default:
                return(0f);
            }
        }
 public WeaponProficiency(ProficiencyLevel lvl, EquipmentSubtype name) : base(lvl)
 {
     this.type = name;
 }
 public Proficiency(ProficiencyLevel lvl)
 {
     level = lvl;
 }
 public SaveProficiency(ProficiencyLevel lvl, AbilityType type) : base(lvl)
 {
     this.type = type;
 }
Exemplo n.º 9
0
 public SaveProficiencyFeature(AbilityType abilityType, ProficiencyLevel lvl, FeatureBundle parent = null) : base(parent)
 {
     this.abilityType = abilityType;
     this.lvl         = lvl;
 }
Exemplo n.º 10
0
 public SaveProficiencyFeature(SaveProficiencyFeatureWrapper wrap)
 {
     this.abilityType = wrap.abilityType;
     this.lvl         = wrap.lvl;
 }
 public WeaponProficiencyFeature(WeaponProficiencyFeatureWrapper wrap)
 {
     this.weaponType = wrap.weaponType;
     this.lvl        = wrap.lvl;
 }
 public WeaponProficiencyFeature(EquipmentSubtype weaponType, ProficiencyLevel lvl, FeatureBundle parent = null) : base(parent)
 {
     this.weaponType = weaponType;
     this.lvl        = lvl;
 }
 public ArmourProficiencyFeature(ArmourProficiencyFeatureWrapper wrap)
 {
     this.armourType = wrap.armourType;
     this.lvl        = wrap.lvl;
 }
 public ArmourProficiencyFeature(EquipmentType armourType, ProficiencyLevel lvl, FeatureBundle parent = null) : base(parent)
 {
     this.armourType = armourType;
     this.lvl        = lvl;
 }
Exemplo n.º 15
0
 public void IncProficiency()
 {
     Proficiency = (ProficiencyLevel)( ((Int32)Proficiency + 1) % (Int32)ProficiencyLevel.ProficiencyLevelCount);
 }
Exemplo n.º 16
0
 private static int HEnumToHInt(ProficiencyLevel pl)
 {
     switch (pl)
     {
         case ProficiencyLevel.Average:
             return 2;
         case ProficiencyLevel.High:
             return 4;
         case ProficiencyLevel.Low:
             return 1;
         default:
             return 1;
     }
 }
Exemplo n.º 17
0
 public void DecProficiency()
 {
     Proficiency = (ProficiencyLevel)(((Int32)Proficiency - 1) % (Int32)ProficiencyLevel.ProficiencyLevelCount);
 }
 public ArmourProficiency(ProficiencyLevel lvl, EquipmentType name) : base(lvl)
 {
     this.type = name;
 }
 public SkillProficiency(ProficiencyLevel lvl, SkillType type) : base(lvl)
 {
     this.type = type;
 }
 public SkillProficiencyFeature(SkillType skillType, ProficiencyLevel lvl, FeatureBundle parent = null) : base(parent)
 {
     this.skillType = skillType;
     this.lvl       = lvl;
 }