fix objective comparison so same objectives are not added twice

This commit is contained in:
Florian Stinglmayr 2021-07-09 11:30:11 +02:00
parent 2125844acb
commit 0346b8e7e7
2 changed files with 3 additions and 2 deletions

View File

@ -1,9 +1,10 @@
using System.Collections.Generic;
using System;
using System.Text;
using Newtonsoft.Json;
namespace NonaBGS.BGS {
public class Objective {
public class Objective : IComparable<Objective> {
private string system;
private string station;
private string faction;

View File

@ -21,7 +21,7 @@ namespace NonaBGS.BGS {
}
public bool AddObjective(Objective objective) {
var found = objectives.Find(x => x == objective);
var found = objectives.Find(x => x.CompareTo(objective) == 0);
bool added = false;
if (found == null) {