public PuzzlePanel() : base() { instance = this; this.button_size = Puzzle.Instance.ButtonSize; this.n = Puzzle.Instance.N; this.m = Puzzle.Instance.M; this.edges = (EdgeView)Puzzle.Instance.Edges.View; this.fields = (FieldView)Puzzle.Instance.Fields.View; this.points = (PointView)Puzzle.Instance.Points.View; this.Size = new System.Drawing.Size(button_size * (m * 3 + 1), button_size * (n * 3 + 1)); PreparePictures(); }
protected void Initialize( PuzzleController newController, Point pointElement = null, Edge edgeElement = null, Field fieldElement = null) { shortInfo = new PuzzleData(name, this.GetType(), n, m); if (pointElement == null) { points = new BaseElements.BasePoint(); } else { points = pointElement; } if (edgeElement == null) { edges = new BaseElements.BaseEdge(); } else { edges = edgeElement; } if (fieldElement == null) { fields = new BaseElements.BaseField(); } else { fields = fieldElement; } controller = newController; view = new PuzzlePanel(); controller.ModelChangeEvent += view.Refresh; }