public void Run() { liste = importExportHelper.GetGaesteListe(); raum = importExportHelper.GetRaum(); var tStart = importExportHelper.GetTischPosition(); var tGroe = importExportHelper.GetTischGrosse(); Tuple <int, int> tEnde = new Tuple <int, int>(tStart.Item1 + tGroe.Item1, tStart.Item2 + tGroe.Item2); //List<Point> tisch = new List<Point>(); for (int a = tStart.Item1; a <= tEnde.Item1; a++) { for (int b = tStart.Item2; b <= tEnde.Item2; b++) { Point pkt = new Point(a, b); tisch.Add(pkt); } } }
public void ZeichneSpielfeld() { Point tischPos = GetValueFromTupe(DatenManager.GetTischPosition()); Point tischSize = GetValueFromTupe(DatenManager.GetTischGrosse()); Point spielFeld = GetValueFromTupe(DatenManager.GetRaum()); Dictionary <string, Gast> personen = DatenManager.GetGaesteListe(); gameWidth = spielFeld.X * TILEWIDTH; gameHeight = spielFeld.Y * TILEHEIGHT; Pen p = new Pen(Color.Black, 1); //g.Clear(Color.FromKnownColor(KnownColor.Control)); g.FillRectangle(new Pen(Color.White, 1).Brush, new Rectangle(0, 0, gameWidth, gameHeight)); Point startPoint = new Point(0, 0); Point endPoint = new Point(0, 0); for (int x = 0; x <= gameWidth + 1; x += TILEWIDTH) { startPoint = new Point(x, 0); endPoint = new Point(startPoint.X, startPoint.Y + gameHeight); g.DrawLine(p, startPoint, endPoint); } for (int y = 0; y <= gameHeight; y += TILEHEIGHT) { startPoint = new Point(0, y); endPoint = new Point(startPoint.X + gameWidth, startPoint.Y); g.DrawLine(p, startPoint, endPoint); } g.FillRectangle(new Pen(Color.Brown, 1).Brush, new Rectangle(tischPos.X * TILEWIDTH, tischPos.Y * TILEHEIGHT, tischSize.X * TILEWIDTH, tischSize.Y * TILEHEIGHT)); foreach (var pers in personen) { Point point = pers.Value.position; g.FillRectangle(new Pen(Color.Orange, 1).Brush, new Rectangle(point.X * TILEWIDTH, point.Y * TILEHEIGHT, TILEWIDTH, TILEHEIGHT)); } }