fix objective comparison so same objectives are not added twice
This commit is contained in:
parent
2125844acb
commit
0346b8e7e7
@ -1,9 +1,10 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace NonaBGS.BGS {
|
namespace NonaBGS.BGS {
|
||||||
public class Objective {
|
public class Objective : IComparable<Objective> {
|
||||||
private string system;
|
private string system;
|
||||||
private string station;
|
private string station;
|
||||||
private string faction;
|
private string faction;
|
||||||
|
@ -21,7 +21,7 @@ namespace NonaBGS.BGS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool AddObjective(Objective objective) {
|
public bool AddObjective(Objective objective) {
|
||||||
var found = objectives.Find(x => x == objective);
|
var found = objectives.Find(x => x.CompareTo(objective) == 0);
|
||||||
bool added = false;
|
bool added = false;
|
||||||
|
|
||||||
if (found == null) {
|
if (found == null) {
|
||||||
|
Reference in New Issue
Block a user