Example #1
0
        public PctbxMemento(List<Ball> balls)
        {
            this.balls = new List<BallMemento>();

            foreach (var ball in balls)
            {
                var ballMemento = new BallMemento
                {
                    x = ball.X,
                    y = ball.Y,
                    increaseX = ball.IncreaseX,
                    increaseY = ball.IncreaseY
                };

                this.balls.Add(ballMemento);
            }
        }
Example #2
0
        }                                           // for xml serialization

        public PctbxMemento(List <Ball> balls)
        {
            this.balls = new List <BallMemento>();

            foreach (var ball in balls)
            {
                var ballMemento = new BallMemento
                {
                    x         = ball.X,
                    y         = ball.Y,
                    increaseX = ball.IncreaseX,
                    increaseY = ball.IncreaseY
                };

                this.balls.Add(ballMemento);
            }
        }