public HeroPowerPortret(HeroPortret p) { parent = p; center = parent.center; parent.Controls.Add(this); MouseUp += HeroPowerPortret_MouseUp; }
public static Point DefaultLocation(HeroPortret portret) { int y; if (portret.IsA) { y = DBoarder; } else { y = portret.Parent.Height - portret.Height - DBoarder - 30; } int x = portret.Parent.Width - portret.Width - DBoarder; return(new Point(x, y)); }
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); }
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; }