/// <summary> /// Gets the list of plan entries for learning skills for a given attribute, sorted by trainng time (1234123455). /// </summary> /// <param name="attributes"></param> /// <returns></returns> private IEnumerable <PlanEntry> GetLearningEntries(EveAttribute attributes) { StaticSkill lower = StaticSkills.GetLowerAttributeLearningSkill(attributes); StaticSkill upper = StaticSkills.GetUpperAttributeLearningSkill(attributes); yield return(new PlanEntry(m_originalPlan, lower, 1)); yield return(new PlanEntry(m_originalPlan, lower, 2)); yield return(new PlanEntry(m_originalPlan, lower, 3)); yield return(new PlanEntry(m_originalPlan, lower, 4)); yield return(new PlanEntry(m_originalPlan, upper, 1)); yield return(new PlanEntry(m_originalPlan, upper, 2)); yield return(new PlanEntry(m_originalPlan, upper, 3)); yield return(new PlanEntry(m_originalPlan, upper, 4)); yield return(new PlanEntry(m_originalPlan, lower, 5)); yield return(new PlanEntry(m_originalPlan, upper, 5)); }
/// <summary> /// Gets a skill by its ID or its name. /// </summary> /// <param name="serial">The serial.</param> /// <returns></returns> private static StaticSkill GetSkill(SerializablePlanEntry serial) { // Try get skill by its ID StaticSkill skill = StaticSkills.GetSkillByID(serial.ID) ?? StaticSkills.GetSkillByName(serial.SkillName); // We failed? Try get skill by its name return(skill); }
/// <summary> /// Constructor from a character attribute. /// </summary> /// <param name="character"></param> /// <param name="attrib"></param> internal CharacterAttribute(Character character, EveAttribute attrib) { m_base = 5; m_attrib = attrib; m_character = character; m_lowerSkill = character.Skills[StaticSkills.GetLowerAttributeLearningSkill(attrib)]; m_upperSkill = character.Skills[StaticSkills.GetUpperAttributeLearningSkill(attrib)]; }
/// <summary> /// Constructor from the API. /// </summary> /// <param name="src"></param> internal ResearchPoint(SerializableResearchListItem src) { GetAgentInfoByID(src.AgentID); AgentID = src.AgentID; Skill = StaticSkills.GetSkillByID(src.SkillID); StartDate = src.ResearchStartDate; PointsPerDay = src.PointsPerDay; m_remainderPoints = src.RemainderPoints; ResearchedItem = GetDatacore(); }
/// <summary> /// Constructor from the API. /// </summary> /// <param name="src">The source item</param> /// <param name="character">The owning character</param> internal ResearchPoint(EsiResearchListItem src, CCPCharacter character) { GetAgentInfoByID(src.AgentID); AgentID = src.AgentID; Skill = StaticSkills.GetSkillByID(src.SkillID); StartDate = src.ResearchStartDate; PointsPerDay = src.PointsPerDay; m_character = character; m_remainderPoints = src.RemainderPoints; ResearchedItem = GetDatacore(); }
private IEnumerable <SerializableCharacterSkill> GetSkills(List <GetCharactersCharacterIdSkillsSkill> characterSkills) { var skills = characterSkills.Select(x => new SerializableCharacterSkill { ID = x.SkillId.GetValueOrDefault(), Name = StaticSkills.GetSkillByID(x.SkillId.GetValueOrDefault()).Name, //This gets weird with alpha clones so we are just going to assume trained level Level = x.TrainedSkillLevel.GetValueOrDefault(), Skillpoints = x.SkillpointsInSkill.GetValueOrDefault(), }); return(skills); }
/// <summary> /// Gets a skill by its ID or its name /// </summary> /// <param name="name"></param> /// <returns></returns> public static StaticSkill GetSkill(SerializablePlanEntry serial) { // Try get skill by its ID StaticSkill skill = StaticSkills.GetSkillById(serial.ID); // We failed? Try get skill by its name if (skill == null) { skill = StaticSkills.GetSkillByName(serial.SkillName); } return(skill); }
/// <summary> /// Gets the skills for each race. /// </summary> /// <returns></returns> private List <SerializableCharacterSkill> GetSkillsForRace() { var skills = new List <SerializableCharacterSkill>(); var startingSkills = new Dictionary <int, int>(); switch (m_race) { case Race.Amarr: startingSkills = s_allRaceSkills.Concat(s_amarrRaceSkills).ToDictionary(x => x.Key, x => x.Value); break; case Race.Caldari: startingSkills = s_allRaceSkills.Concat(s_caldariRaceSkills).ToDictionary(x => x.Key, x => x.Value); break; case Race.Gallente: startingSkills = s_allRaceSkills.Concat(s_gallenteRaceSkills).ToDictionary(x => x.Key, x => x.Value); break; case Race.Minmatar: startingSkills = s_allRaceSkills.Concat(s_minmatarRaceSkills).ToDictionary(x => x.Key, x => x.Value); break; } foreach (var raceSkill in startingSkills) { var staticSkill = StaticSkills.GetSkillById(raceSkill.Key); if (staticSkill == null) { continue; } var skill = new SerializableCharacterSkill() { ID = raceSkill.Key, Level = raceSkill.Value, Name = StaticSkills.GetSkillById(raceSkill.Key).Name, Skillpoints = StaticSkills.GetSkillById(raceSkill.Key).GetPointsRequiredForLevel(raceSkill.Value), IsKnown = true, OwnsBook = false, }; skills.Add(skill); } return(skills); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="character"></param> /// <param name="serial"></param> internal PlanEntry(BasePlan owner, SerializablePlanEntry serial) { m_owner = owner; m_entryType = serial.Type; m_skill = StaticSkills.GetSkillByName(serial.SkillName); m_level = serial.Level; m_notes = serial.Notes; m_priority = serial.Priority; foreach (var group in serial.PlanGroups) { m_planGroups.Add(group); } if (serial.Remapping != null) { m_remapping = new RemappingPoint(serial.Remapping); } }
/// <summary> /// Loads the static data. /// </summary> public static async Task LoadAsync() { // Quit if the client has been shut down if (EveMonClient.Closed) { return; } // This is the time optimal loading order // (min order to follow : // skills before anything else, // properties before items, // items before blueprints, reprocessing and certificates, // certs before masteries) EveMonClient.Trace("Datafiles.Load - begin", printMethod: false); // Must always run first // It will have finished loading until static skills finish Task properties = TaskHelper.RunIOBoundTaskAsync(() => StaticProperties.Load()); // Must always run before items Task skills = TaskHelper.RunIOBoundTaskAsync(() => StaticSkills.Load()); await Task.WhenAll(skills, properties); // Must always run synchronously as blueprints, reprocessing and certificates depend on it await TaskHelper.RunIOBoundTaskAsync(() => StaticItems.Load()); // Must always run synchronously as masteries depend on it await TaskHelper.RunIOBoundTaskAsync(() => StaticCertificates.Load()); // Must always run synchronously as ID to name depends on it await TaskHelper.RunIOBoundTaskAsync(() => StaticGeography.Load()); // Non critical loadings as all dependencies have been loaded Task blueprints = TaskHelper.RunIOBoundTaskAsync(() => StaticBlueprints.Load()); Task reprocessing = TaskHelper.RunIOBoundTaskAsync(() => StaticReprocessing.Load()); await TaskHelper.RunIOBoundTaskAsync(() => StaticMasteries.Load()); EveMonClient.Trace("Datafiles.Load - done", printMethod: false); }
/// <summary> /// Gets the skills for each race. /// </summary> /// <returns></returns> private static IEnumerable <SerializableCharacterSkill> GetSkillsForRace() { Dictionary <int, int> startingSkills = GetStartingSkills(); return(startingSkills.Select( raceSkill => new { raceSkill, staticSkill = StaticSkills.GetSkillByID(raceSkill.Key) }).Where(raceSkill => raceSkill.staticSkill != null).Select( skill => new SerializableCharacterSkill { ID = skill.raceSkill.Key, Level = skill.raceSkill.Value, Name = StaticSkills.GetSkillByID(skill.raceSkill.Key).Name, Skillpoints = StaticSkills.GetSkillByID(skill.raceSkill.Key).GetPointsRequiredForLevel (skill.raceSkill.Value), IsKnown = true, OwnsBook = false, })); }
/// <summary> /// Initializes paths, static objects, check and load datafiles, etc. /// </summary> /// <remarks>May be called more than once without causing redundant operations to occur.</remarks> public static void Initialize() { lock (s_initializationLock) { if (s_initialized) { return; } s_initialized = true; Trace("EveClient.Initialize() - begin"); // Members instantiations HttpWebService = new HttpWebService(); APIProviders = new GlobalAPIProviderCollection(); MonitoredCharacters = new GlobalMonitoredCharacterCollection(); CharacterIdentities = new GlobalCharacterIdentityCollection(); Notifications = new GlobalNotificationCollection(); Characters = new GlobalCharacterCollection(); Datafiles = new GlobalDatafileCollection(); Accounts = new GlobalAccountCollection(); EVEServer = new EveServer(); // Load static datas (min order to follow : skills before anything else, items before certs) Trace("Load Datafiles - begin"); StaticProperties.Load(); StaticSkills.Load(); StaticItems.Load(); StaticCertificates.Load(); StaticBlueprints.Load(); Trace("Load Datafiles - done"); // Network monitoring (connection availability changes) NetworkMonitor.Initialize(); Trace("EveClient.Initialize() - done"); } }
/// <summary> /// Gets the skill name by its ID. /// </summary> /// <param name="id"></param> /// <returns></returns> private static string GetSkillName(int id) { StaticSkill skill = StaticSkills.GetSkillById(id); return(skill != null ? skill.Name : String.Empty); }