This commit is contained in:
Beppe
2019-07-06 01:41:20 +02:00
parent df39b0392c
commit d883bce694
16 changed files with 110 additions and 33 deletions

View File

@@ -24,7 +24,7 @@ namespace Globals.classes
public override bool Equals(object obj)
{
Bet b = (Bet)obj;
return b.game == this.game && this.person == b.person && b.cash == this.cash && this.ploeg == b.ploeg;
return this.Id == b.Id;
}
public override int GetHashCode()
@@ -51,7 +51,7 @@ namespace Globals.classes
public override string ToString()
{
return person.ToString() + ":" + this.cash + "$ on " + this.game.ToString();
return this.Id + ": " + person.ToString() + ":" + this.cash + "$ on " + this.game.ToString();
}
}
}

View File

@@ -71,8 +71,9 @@ namespace Globals.classes
public override bool Equals(object obj)
{
Game g = (Game)obj;
return this.home == g.away;
Game ga = (Game)obj;
return this.Id == ga.Id;
}
public override int GetHashCode()
@@ -83,7 +84,7 @@ namespace Globals.classes
public override string ToString()
{
return this.home.ToString() + " / " + this.away.ToString();
return this.Id + ": " + this.home.ToString() + " / " + this.away.ToString();
}
}
}

View File

@@ -34,7 +34,7 @@ namespace Globals.classes
public override string ToString()
{
return this.name + " " + this.lastname;
return this.Id + ": " +this.name + " " + this.lastname;
}
}
}

View File

@@ -16,6 +16,12 @@ namespace Globals.classes
{
this.score = score;
}
public Ploeg(string naam, int score, int Id)
{
this.score = score;
this.naam = naam;
this.Id = Id;
}
public int Id { get; set; }
public string naam { get; set; }
@@ -24,6 +30,14 @@ namespace Globals.classes
public override bool Equals(object obj)
{
try
{
Ploeg te = (Ploeg)obj;
} catch (Exception e)
{
return false;
}
Ploeg t = (Ploeg)obj;
return this.Id == t.Id;
}
@@ -40,7 +54,7 @@ namespace Globals.classes
{
score = ":" + this.score;
}
return this.naam + score;
return this.Id + ": " + this.naam + score;
}
}

View File

@@ -21,5 +21,9 @@ namespace Globals.Interfaces
void save();
void updateGame(Game g);
void updatePerson(Person p);
Person getPersonByString(string s);
Ploeg getPloegByString(string s);
Game getGameByString(string s);
Bet getBetByString(string s);
}
}

View File

@@ -6,4 +6,5 @@ namespace Globals
{
public enum state { draw, home, away };
}
}