Пример #1
0
        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);
        }