Beispiel #1
0
        public BallPosition GenerateBall()
        {
            List<Position> fp = this.getFree();

            if (1 > fp.Count)
            {
                throw new Exception("No free cells");
            }

            Position p = Support.SRandom.Random<Position>(fp);

            Ball b = Ball.Random();
            BallPosition bp = new BallPosition();
            bp.Ball = b;
            bp.Position = p;

            return bp;
        }
Beispiel #2
0
 public void SetBall(BallPosition bp)
 {
     this.Balls[bp.Position.Top, bp.Position.Left] = bp.Ball;
 }