private void CopyBorderPototypeToAll() { borderArea.MakeEmpty(); IBorder border = (IBorder)borderPrototype_Top.Clone(); Point Location = new Point(); Size size = border.Size; //TOP BORDER Location = new Point(0, 0); border.Location = Location; border.Size = size; border.Place = Place.Top; borders.TopBorder = (IBorder)border.Clone(); //BOTTOM BORDER Location.Y = Height - size.Height; border.Location = Location; border.Size = size; border.Place = Place.Bottom; borders.BottomBorder = (IBorder)border.Clone(); //LEFT BORDER size.Width = border.Size.Height; size.Height = border.Size.Width; border.Size = size; Location = new Point(0, 0); border.Location = Location; border.Place = Place.Left; borders.LeftBorder = (IBorder)border.Clone(); //RIGHT BORDER Location.X = Width - border.Size.Width; border.Size = size; border.Location = Location; border.Place = Place.Right; borders.RightBorder = (IBorder)border.Clone(); borderArea = borders.GetRegion(); }
protected override Game.Characters.Item Copy() { Board board = new BoardGame.Board(); board.Ball = (IBall)Ball.Clone(); board.Plank = (IPlank)Plank.Clone(); board.BorderPrototype = (IBorder)BorderPrototype.Clone(); board.borderToDraw = (IBorder)borderToDraw.Clone(); board.WidthOfBorders = WidthOfBorders; board.Turns = Turns; board.IsPause = IsPause; board.IsEndGame = IsEndGame; board.IsGameStart = IsGameStart; board.IntervalBallSpeed = IntervalBallSpeed; return(board); }