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";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -35,21 +35,18 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Classes\PloegInMatch.cs" />
|
||||
<Compile Include="MyClass.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Classes\Bet.cs" />
|
||||
<Compile Include="Classes\Game.cs" />
|
||||
<Compile Include="Classes\Person.cs" />
|
||||
<Compile Include="Classes\Ploeg.cs" />
|
||||
<Compile Include="Interfaces\IBet.cs" />
|
||||
<Compile Include="Interfaces\IData.cs" />
|
||||
<Compile Include="Interfaces\IGame.cs" />
|
||||
<Compile Include="Interfaces\ILogic.cs" />
|
||||
<Compile Include="Interfaces\IPerson.cs" />
|
||||
<Compile Include="Interfaces\IPloeg.cs" />
|
||||
<Compile Include="main.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
|
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Globals.classes;
|
||||
|
||||
namespace Globals.Interfaces
|
||||
{
|
||||
public interface IData
|
||||
{
|
||||
List<Person> getPersons();
|
||||
List<Game> getGames();
|
||||
List<Ploeg> getPloegen();
|
||||
List<Bet> getBets();
|
||||
void saveBets(List<Bet> b);
|
||||
void saveGames(List<Game> g);
|
||||
void savePloegen(List<Ploeg> p);
|
||||
void savePersons(List<Person> p);
|
||||
}
|
||||
}
|
@@ -6,24 +6,22 @@ namespace Globals.Interfaces
|
||||
{
|
||||
public interface ILogic
|
||||
{
|
||||
List<Person> persons { get; set; }
|
||||
List<Bet> bets { get; set; }
|
||||
List<Ploeg> ploegen { get; set; }
|
||||
List<Game> games { get; set; }
|
||||
Person getPerson(int id);
|
||||
Bet getBet(int id);
|
||||
Ploeg getPloeg(int id);
|
||||
Game getGame(int id);
|
||||
void addPloeg(Ploeg p);
|
||||
void addGame(Game g);
|
||||
|
||||
void addBet(Bet b);
|
||||
void addGame(Game g);
|
||||
void addPerson(Person p);
|
||||
void addPloeg(Ploeg p);
|
||||
void addPloegInMatch(PloegInMatch p);
|
||||
Bet getBet(int id);
|
||||
List<Bet> GetBets();
|
||||
Game getGame(int id);
|
||||
List<Game> GetGames();
|
||||
Person getPerson(int id);
|
||||
List<Person> GetPeople();
|
||||
Ploeg getPloeg(string naam);
|
||||
List<Ploeg> GetPloegen();
|
||||
PloegInMatch GetPloegInMatch(int id);
|
||||
List<PloegInMatch> GetPloegInMatches();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,6 @@ namespace Globals.Interfaces
|
||||
{
|
||||
public interface IPloeg
|
||||
{
|
||||
int Id { get; set; }
|
||||
string naam { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user