45 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using EDPlayerJournal.Entries;
 | |
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Threading.Tasks;
 | |
| 
 | |
| namespace EDPlayerJournal.BGS;
 | |
| 
 | |
| public class ThargoidKill : Transaction {
 | |
|     /// <summary>
 | |
|     /// Thargoid vessel that was killed
 | |
|     /// </summary>
 | |
|     public ThargoidVessel ThargoidType { get; set; } = ThargoidVessel.Unknown;
 | |
| 
 | |
|     /// <summary>
 | |
|     /// Name of the thargoid type killed
 | |
|     /// </summary>
 | |
|     public string? ThargoidName { get; set; }
 | |
| 
 | |
|     /// <summary>
 | |
|     /// Total reward received
 | |
|     /// </summary>
 | |
|     public ulong TotalReward {
 | |
|         get { return (ulong)Entries.OfType<FactionKillBondEntry>().Sum(x => (decimal)x.Reward); }
 | |
|     }
 | |
| 
 | |
|     public ThargoidKill() { }
 | |
| 
 | |
|     public ThargoidKill(FactionKillBondEntry entry) {
 | |
|         if (string.Compare(entry.VictimFaction, Thargoid.ThargoidFaction) != 0) {
 | |
|             throw new Exception("Not a valid thargoid kill");
 | |
|         }
 | |
| 
 | |
|         Entries.Add(entry);
 | |
| 
 | |
|         ThargoidType = Thargoid.GetVesselByPayout(entry.Reward);
 | |
|         ThargoidName = Thargoid.GetVesselName(ThargoidType);
 | |
|     }
 | |
| 
 | |
|     public override string ToString() {
 | |
|         return string.Format("{0}x {1} killed", Entries.Count, ThargoidName);
 | |
|     }
 | |
| }
 |