Пример #1
0
        public HandCardPortret(HandControl h, Card c) : base(h.center, c)
        {
            hand = h;

            if (card is IDealDamage idd)
            {
                dealDamageCard = idd;
            }
            else
            {
                dealDamageCard = null;
            }

            h.Controls.Add(this);
        }
Пример #2
0
        public ControlCenter(GameInstance g, GamingForm f)
        {
            parent  = f;
            game    = g;
            g.Input = GetInput;

            InvokeRebuild = () => parent.Invoke((Action)ReBuild);
            Input         = (p) =>
            {
                parent.Invoke(InvokeRebuild);
                return(true);
            };

            endButt = new EndTurnButton(this);
            HeroA   = new HeroPortret(this, true);
            HeroB   = new HeroPortret(this, false);
            AHand   = new HandControl(this, true);
            BHand   = new HandControl(this, false);
            boardC  = new BoardControl(this);
        }
Пример #3
0
        public GamingForm(GameInstance g)
        {
            CheckForIllegalCrossThreadCalls = false;
            KeyPreview      = true;
            StartPosition   = FormStartPosition.CenterScreen;
            FormBorderStyle = FormBorderStyle.FixedToolWindow;

            Size = new Size(1300, 700);

            center = new ControlCenter(g, this);

            center.boardC.Location = BoardControl.StdLocation(center.boardC);

            center.HeroA.Location = HeroPortret.DefaultLocation(center.HeroA);
            center.HeroB.Location = HeroPortret.DefaultLocation(center.HeroB);

            center.AHand.Location = HandControl.StdLocation(center.AHand, false);
            center.BHand.Location = HandControl.StdLocation(center.BHand, true);

            center.endButt.Location = EndTurnButton.StdLocation(center.endButt);

            Load += StdForm_Load;
        }
Пример #4
0
        public static Point StdLocation(HandControl c, bool up)
        {
            int y = up ? c.center.parent.Height - c.Height - 20 - 30 : 20;

            return(new Point((c.center.parent.Width - HeroPortret.StdSize.Width - DBoarder) / 2 - c.Width / 2, y));
        }