public ProjectTechnology(string name, DateTime firstUse, ProjectTechnologyCategory category = null, DateTime?lastUse = null, Frequencies usageFrequency = Frequencies.Daily, Proficiencies proficiency = Proficiencies.Intermediate) { Id = ++id; Name = name; FirstUse = firstUse; Category = category; LastUse = lastUse; UsageFrequency = usageFrequency; Proficiency = proficiency; }
public int SkillMod(Skills skill) { if (Proficiencies.Contains(skill.ToString())) { return(StatMod(baseStats.skillStats[skill]) + baseStats.proficiencyBonus); } else { return(StatMod(baseStats.skillStats[skill])); } }
public void RemoveProficiency(string proficiency) { for (int i = 0; i < Proficiencies.Count; i++) { if (Proficiencies[i].Equals(proficiency)) { Proficiencies.RemoveAt(i); return; } } }
/// <summary> /// Adds a proficiency to the List of proficiencies for this object. /// </summary> /// <param name="proficiency"></param> public void AddProficiency(string proficiency) { if (!string.IsNullOrEmpty(proficiency) && Proficiencies != null) { Proficiencies.Add(proficiency); return; } throw new ArgumentNullException(nameof(proficiency), $"{nameof(Proficiencies)} cannot have an empty or null value assigned to it. Alternatively, " + $"{nameof(Proficiencies)} itself cannot be null when assigning a value to it."); }
public Background( string Name, string proficiency1 = null, string proficiency2 = null, Tool tool1 = null, Tool tool2 = null, Language language1 = null, Language language2 = null) { this.Name = Name; if (proficiency1 != null) { Proficiencies.Add(proficiency1); } if (proficiency2 != null) { Proficiencies.Add(proficiency2); } if (tool1 != null) { Tools.Add(tool1); } if (tool2 != null) { Tools.Add(tool2); } if (language1 != null) { Languages.Add(language1); } if (language2 != null) { Languages.Add(language2); } }
public static ProficiencyModel ProfGet(this List<ProficiencyModel> list, Proficiencies prof) { var index = (int)prof; return list.Count > index ? list[index] : new ProficiencyModel(); }
public Unit(int id, string[] txtUnitData) { ID = id; List <string[]> fs = new List <string[]>(); foreach (var line in txtUnitData) { fs.Add(line.Replace("\r\n", "").Split(' ')); } TroopID = fs[0][0]; EngSingleName = fs[0][1].Replace('_', ' '); EngMultiplyName = fs[0][2].Replace('_', ' '); //Flags var flagsNum = Convert.ToInt32(fs[0][4]); foreach (var df in dividendsFlags) { var dr = App.GetDivRsltAndRest(flagsNum, df.Value); flagsNum = dr[1]; Flags.Add(df.Key, (byte)dr[0]); } FactionID = Convert.ToInt32(fs[0][7]); UpgradePath[0] = Convert.ToInt32(fs[0][8]); UpgradePath[1] = Convert.ToInt32(fs[0][9]); //Items List <int> itms = new List <int>(); foreach (var it in fs[1]) { if (it.Equals("0") || it.Equals("")) { continue; } if (it.Equals("-1")) { break; } itms.Add(Convert.ToInt32(it)); } ItemsIDs = itms.ToArray(); //Attributes var attrs = Enum.GetValues(typeof(Attribute)); int iattrs = 2; foreach (var attr in attrs) { Attributes.Add((Attribute)attr, (byte)Convert.ToInt16(fs[2][iattrs++])); } //Level Level = (byte)Convert.ToInt16(fs[2][6]); //Proficiencies var prfs = Enum.GetValues(typeof(Proficiency)); int iprfs = 1; foreach (var prf in prfs) { Proficiencies.Add((Proficiency)prf, (byte)Convert.ToInt32(fs[3][iprfs++])); } //Skills for (int i = 0; i < dividendsSkills.Length; i++) { var dividend = Convert.ToInt64(fs[4][i]); foreach (var sk in dividendsSkills[i]) { var rd = App.GetDivRsltAndRest(dividend, sk.Value); dividend = rd[1]; Skills.Add(sk.Key, (byte)rd[0]); } } }
public Skill(Proficiencies _name, Trait _trait = Trait.NONE, Proficiency _level = Proficiency.NONE) { name = _name; trait = _trait; level = _level; }
/// <summary> /// Writes a save to a folder. The save name is generated based on the save number stored by /// this save. /// </summary> /// <param name="saveDirectory"></param> public void Write(string saveDirectory) { // The output file is indicated by the save number. var writer = new BinaryWriter(File.Create(Path.Combine(saveDirectory, SaveFileName))); //BinaryWriter writer = new BinaryWriter(stream); // Firstly, write the header. writer.Write(Header); Details.Write(writer); // Now the skills. writer.Write(Proficiencies.ActiveCount + Skills.ActiveCount); Proficiencies.WriteAllProficiencies(writer); Skills.WriteAllSkills(writer); // Some unknown stuff. writer.Write(Vehicle1Color); writer.Write(Vehicle2Color); writer.Write(UnknownVariable4); writer.Write(UnknownVariable5); // Ammo. writer.Write(Ammo.Count); foreach (var ammo in Ammo) { ammo.Value.Write(writer); } // Items. writer.Write(Items.Count); foreach (var item in Items) { item.Write(writer); } writer.Write(BackpackSlots); writer.Write(WeaponSlots); // Weapons. writer.Write(Weapons.Count); foreach (var weapon in Weapons) { weapon.Write(writer); } // Stats. StatTable.Write(writer); // Visited locations. writer.Write(LocationsVisited.Count); foreach (var location in LocationsVisited) { writer.BL_WriteString(location.InternalName()); } writer.BL_WriteString(CurrentLocation.InternalName()); writer.Write(UnknownVariable6); writer.Write(UnknownVariable7); writer.BL_WriteString(UnknownVariable8); writer.Write(UnknownVariable9); writer.Write(UnknownVariable10); writer.Write(SaveNumber); writer.Write(UnknownVariable12); writer.Write(0u); // Playthroughs. writer.Write(Playthroughs.Count); foreach (var playthrough in Playthroughs) { writer.Write(playthrough.Number); writer.BL_WriteString(playthrough.ActiveMissionName); writer.Write(playthrough.FoundMissionsCount); foreach (var mission in playthrough.Missions) { if (mission.Value.Status != Mission.MissionStatus.Unknown) { writer.BL_WriteString(mission.Value.InternalName); writer.Write(mission.Value.MissionStatusFlag); writer.Write(mission.Value.UnknownVariable2); writer.Write(mission.Value.UnknownVariable3); writer.Write(mission.Value.Details.Count); foreach (var detail in mission.Value.Details) { writer.BL_WriteString(detail.UnknownString); writer.Write(detail.UnknownVariable); } } } } writer.Write(PlayTimeSeconds); writer.BL_WriteString(SaveTimeString); writer.BL_WriteString(Name); writer.Write(Color1ARGB); writer.Write(Color2ARGB); writer.Write(Color3ARGB); writer.Write(UnknownVariable14); writer.Write(UnknownVariable15.Count); foreach (Int32 x in UnknownVariable15) { writer.Write(x); } writer.Write(UnknownVariable16.Count); foreach (Int32 x in UnknownVariable16) { writer.Write(x); } // Echo writer.Write(EchoPlaythroughs.Count); foreach (var echoPlaythrough in EchoPlaythroughs) { writer.Write(echoPlaythrough.Playthrough); writer.Write(echoPlaythrough.Echoes.Count); foreach (var echo in echoPlaythrough.Echoes) { writer.BL_WriteString(echo.InternalName); writer.Write(echo.UnknownVariable1); writer.Write(echo.UnknownVariable2); } } writer.Write(UnknownVariable17.Length); writer.Write(UnknownVariable17); writer.Close(); }
public bool IsProficientInWeapon(Weapon weapon) { return(Proficiencies.Contains(weapon.weaponCategory.ToString()) || Proficiencies.Contains(weapon.weaponType.ToString()) || weapon.weaponCategory == WeaponCategories.NaturalWeapon); }
public static ProficiencyModel ProficiencyGet(Proficiencies id, string name, Abilities stat, ProficiencyTypes type) { return new ProficiencyModel { Id = id, Name = name, Ability = stat, Type = type }; }