public PlayerArgs(PlayArea area = null) { if (area != null) DrawLocation = area.Location; }
private void GeneratePlayAreas(ClientGameState state) { int horizontalSpacing = Width / 4; int playerAreaWidth = PlayArea.DEFAULTSIZE.Width; int padding = (horizontalSpacing - playerAreaWidth) / 2; int borderBottom = 720; int offsetBottom = borderBottom - PlayArea.DEFAULTSIZE.Height; int borderTop = 0; int paddingSide = 10; int offsetTop = borderTop + PlayArea.DEFAULTSIZE.Height; int locationVertical = (offsetBottom - offsetTop - playerAreaWidth) / 2 + offsetTop + 60; for (var i = 0; i < PlayerAreas.Length; i++) { var area = new PlayArea(state, i); if (i < 8) area.Location = new Point((i % 4) * horizontalSpacing + padding, i / 4 == 0 ? offsetBottom : borderTop); else area.Location = new Point(i == 8 ? -50 : Width - paddingSide - PlayArea.DEFAULTSIZE.Height - 50, locationVertical); Objects.AddLast(area); PlayerAreas[i] = area; } }