예제 #1
0
        /// <summary>
        /// Find stats for a list of pilots
        /// </summary>
        /// <param name="pilots"></param>
        /// <returns></returns>
        public async Task <PilotStats> FindStatsFor(Affiliation affiliation)
        {
            PilotStats stats = await statController.GetPilotStats(affiliation.Character_Id);

            stats.Notes = GetNotesFor(stats);
            PilotId pilot = pilots.Find(x => x.Id == affiliation.Character_Id);

            cache.Add(pilot, affiliation, stats);

            return(stats);
        }
예제 #2
0
파일: Cache.cs 프로젝트: kshannoninnes/Loci
        /// <summary>
        /// Add a row to the cache
        /// </summary>
        /// <param name="pilot">Pilot object containing Id and Name</param>
        /// <param name="affiliation">Affiliation object containing Corporation and Alliance</param>
        /// <param name="stats">PilotStats object containing DangerPercent, SoloPercent, and Notes</param>
        public void Add(PilotId pilot, Affiliation affiliation, PilotStats stats)
        {
            Row row = new Row
            {
                Pilot_Name     = pilot.Name,
                Pilot_Id       = pilot.Id,
                Corp_Name      = affiliation.Corporation,
                Alliance_Name  = affiliation.Alliance,
                Danger_Percent = stats.DangerPercent,
                Solo_Percent   = stats.SoloPercent,
                Notes          = stats.Notes
            };

            if (!Contains(row.Pilot_Name))
            {
                cache.Add(row);
            }
        }