mirror of
https://github.com/bvanroll/cs-oo-project.git
synced 2025-08-29 20:12:40 +00:00
ui nog wa aanpasse en we zijn gucci
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Globals.classes
|
||||
this.home.scoreChanged += homeSet;
|
||||
this.away.scoreChanged += awaySet;
|
||||
}
|
||||
public Game(int id, Ploeg home, Ploeg away, int scoreHome, int scoreAway)
|
||||
public Game(int id, PloegInMatch home, PloegInMatch away, int scoreHome, int scoreAway)
|
||||
{
|
||||
homeSetBool = false;
|
||||
awaySetBool = false;
|
||||
|
@@ -35,8 +35,15 @@ namespace Globals.classes
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
Person p = (Person)obj;
|
||||
return this.Id == p.Id;
|
||||
try
|
||||
{
|
||||
|
||||
Person p = (Person)obj;
|
||||
return this.Id == p.Id;
|
||||
} catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
|
@@ -6,23 +6,20 @@ namespace Globals.classes
|
||||
{
|
||||
public class Ploeg : IPloeg
|
||||
{
|
||||
public Ploeg(int id, string naam)
|
||||
public Ploeg(string naam)
|
||||
{
|
||||
Id = id;
|
||||
this.naam = naam;
|
||||
}
|
||||
|
||||
public Ploeg(Ploeg p)
|
||||
{
|
||||
this.Id = p.Id;
|
||||
this.naam = p.naam;
|
||||
}
|
||||
public int Id { get; set; }
|
||||
public string naam { get; set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return base.Equals(obj);
|
||||
return ((Ploeg)obj).naam == this.naam;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
@@ -9,26 +9,29 @@ namespace Globals.classes
|
||||
{
|
||||
public class PloegInMatch : Ploeg
|
||||
{
|
||||
public PloegInMatch(int id, string naam) : base(id, naam)
|
||||
public int Id;
|
||||
public PloegInMatch(int id, string naam) : base( naam)
|
||||
{
|
||||
this.Id = id;
|
||||
}
|
||||
|
||||
public PloegInMatch(int id, string naam, int score) : base(id, naam)
|
||||
public PloegInMatch(int id, string naam, int score) : base(naam)
|
||||
{
|
||||
this.Id = id;
|
||||
setScore(score);
|
||||
}
|
||||
|
||||
public PloegInMatch(Ploeg p) : base(p)
|
||||
public PloegInMatch(Ploeg p, int id) : base(p)
|
||||
{
|
||||
this.Id = p.Id;
|
||||
this.Id = id;
|
||||
this.naam = p.naam;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public PloegInMatch(Ploeg p, int score) : base(p)
|
||||
public PloegInMatch(Ploeg p, int score, int id) : base(p)
|
||||
{
|
||||
this.Id = p.Id;
|
||||
this.Id = id;
|
||||
this.naam = p.naam;
|
||||
setScore(score);
|
||||
|
||||
@@ -46,6 +49,16 @@ namespace Globals.classes
|
||||
this.scoreSet = true;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (this.scoreSet) return this.naam + ": " +this.score;
|
||||
else return this.naam + ": NaN";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user