From e32405674a47bb18122fdbff5877869cc270b2c1 Mon Sep 17 00:00:00 2001 From: Beppe Vanrolleghem Date: Wed, 7 Aug 2019 13:09:09 +0200 Subject: [PATCH] test ding --- Online Gokkantoor/GUI_Gokkantoor/Login.cs | 8 ++-- .../Globals/Classes/ploegInMatch.cs | 41 +++++++++++++++++++ Online Gokkantoor/Globals/Globals.csproj | 1 + .../Globals/Interfaces/IPloeg.cs | 5 --- Online Gokkantoor/Logic/LogicLayer.cs | 12 +++--- 5 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 Online Gokkantoor/Globals/Classes/ploegInMatch.cs diff --git a/Online Gokkantoor/GUI_Gokkantoor/Login.cs b/Online Gokkantoor/GUI_Gokkantoor/Login.cs index 5b71717..8b7375b 100644 --- a/Online Gokkantoor/GUI_Gokkantoor/Login.cs +++ b/Online Gokkantoor/GUI_Gokkantoor/Login.cs @@ -17,18 +17,16 @@ namespace GUI_Gokkantoor public LogicLayer l; public Login(LogicLayer l) { - l = new LogicLayer(); + this.l = l; InitializeComponent(); listBox1.DataSource = l.persons; + listBox1.DataSource = l.persons; + } private void button1_Click(object sender, EventArgs e) { Person p = (Person)listBox1.SelectedItem; - - - - Gokspel a = new Gokspel(l,p); this.Hide(); a.FormClosed += adminClosed; diff --git a/Online Gokkantoor/Globals/Classes/ploegInMatch.cs b/Online Gokkantoor/Globals/Classes/ploegInMatch.cs new file mode 100644 index 0000000..36fe600 --- /dev/null +++ b/Online Gokkantoor/Globals/Classes/ploegInMatch.cs @@ -0,0 +1,41 @@ +using Globals.classes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Globals.Classes +{ + public class PloegInMatch : Ploeg + { + + + public int score; + + public PloegInMatch(int score) + { + this.score = score; + } + + public override zegMijnNaam(string naam) + { + return "blabla " + naam; + } + + public override bool Equals(object obj) + { + return base.Equals(obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + public override string ToString() + { + return base.ToString(); + } + } +} diff --git a/Online Gokkantoor/Globals/Globals.csproj b/Online Gokkantoor/Globals/Globals.csproj index 8dcf6e6..22e89b2 100644 --- a/Online Gokkantoor/Globals/Globals.csproj +++ b/Online Gokkantoor/Globals/Globals.csproj @@ -34,6 +34,7 @@ + diff --git a/Online Gokkantoor/Globals/Interfaces/IPloeg.cs b/Online Gokkantoor/Globals/Interfaces/IPloeg.cs index 59e574a..3791c4e 100644 --- a/Online Gokkantoor/Globals/Interfaces/IPloeg.cs +++ b/Online Gokkantoor/Globals/Interfaces/IPloeg.cs @@ -5,10 +5,5 @@ namespace Globals.Interfaces { int Id { get; set; } string naam { get; set; } - int score { get; } - bool scoreSet { get; } - event EventHandler scoreChanged; - void setScore(int i); - int getScore(); } } diff --git a/Online Gokkantoor/Logic/LogicLayer.cs b/Online Gokkantoor/Logic/LogicLayer.cs index eea9ca0..44f347b 100644 --- a/Online Gokkantoor/Logic/LogicLayer.cs +++ b/Online Gokkantoor/Logic/LogicLayer.cs @@ -110,11 +110,13 @@ namespace Logic public Person getPerson(int id) { - foreach (Person b in persons) - { - if (b.Id == id) return b; - } - throw new Exception("No bets found with that id"); + return persons.FindLast(x => id == x.Id); + + } + + public List filter(List p) + { + return filter(p); } public Ploeg getPloeg(int id)