EDBGS/EDPlayerJournal/BGS/CombatZone.cs

36 lines
927 B
C#

using System;
using System.Linq;
namespace EDPlayerJournal.BGS;
public class CombatZone : Transaction {
public string Type { get; set; } = "";
public string Grade { get; set; } = "";
public int Amount { get; set; } = 0;
public override int CompareTo(Transaction? obj) {
if (obj == null || obj.GetType() != typeof(CombatZone)) {
return -1;
}
CombatZone? b = obj as CombatZone;
if (b == null) {
return -1;
}
if (b.Faction != Faction || b.System != System) {
return -1; // System and faction don't match
}
if (b.Type != b.Type || b.Grade != b.Grade) {
return -1; // grade and type don't match
}
return 0;
}
public override string ToString() {
return string.Format("Won {0} x {1} {2} Combat Zone(s) for {3}",
Amount, Grade, Type, Faction);
}
}