public GameField() { InitializeComponent(); Id = Guid.NewGuid(); Items.Add(Id, this); Start = new StartForm(this); Start.ShowDialog(); if (Start.IsFinish) return; SetNames(Start); SetScore(); ShowPlayers(Start); lblActivePlayer.Text = Player.GetByActiveIndex(Game.ActivePlayer) + "!"; Sector sector; foreach (var sec in Game.SectorMatrix) { sector = new Sector(Game, sec); Controls.Add(sector); sector.MouseClick += OnSectorMouseClick; foreach (var ball in Sector.BallMatrix) { BallPoint bp = new BallPoint(sector, ball); bp.Click += OnBallPointClick; sector.Controls.Add(bp); } } IsBallNotSector = true; MinimumSize = new Size(SectorCount * FieldStep + FieldLeft, SectorCount * FieldStep + FieldTop); }
public BallPoint(Sector sec, Point p, BallColor ballcolor, bool isColored) { Sector = sec; IsColored = isColored; Coord = p; PointColor = ballcolor; Id = Guid.NewGuid(); Size = new Size(Radius, Radius); BackColor = Color.FromArgb(247, 235, 200); DrawBallPoint(); BackgroundImageLayout = ImageLayout.Zoom; BallPoint b = this; Items.Add(Id, b); }
public BallPoint(Sector sec, Point p) : this(sec, p, BallColor.white, false) { }