Example #1
0
 public IBorderable GetBorder(Position position)
 {
     if (GetBorderOfY(position) is BorderInside) //Border.Inside)
     {
        return GetBorderOfX(position);
     }
     return GetBorderOfY(position);
 }
Example #2
0
 private IBorderable GetBorderOfX(Position position)
 {
     if (position.X >= 0)
     {
         if (position.X < LONG - 1)
         {
             return new BorderInside();
         }
         else
         {
             return new BorderRight();
         }
     }
     return new BorderLeft();
 }
Example #3
0
 public AbstractEntity this[Position position]
 {
     get { return space[position.Y,position.X]; }
 }
Example #4
0
 public Ball(Position position, string name)
 {
     base.Position = position;
     base.Image = 'o';
     this.Name = name;
 }
Example #5
0
 private IBorderable GetBorderOfY(Position position)
 {
     if (position.Y >= 0)
     {
         if (position.Y <= HIGH - 1)
         {
             return new BorderInside();
         }
         else
         {
             return new BorderBottom();
         }
     }
     return new BorderTop();
 }
Example #6
0
 public void RemoveBrick(Position position)
 {
     var findElement = (from b in Bricks
                 where b.Position.X == position.X && b.Position.Y == position.Y
                 select b).ToList();
     foreach (var item in findElement)
     {
         Bricks.Remove(item);
     }
 }
Example #7
0
 public PlatformElement(Position position)
 {
     base.Position = position;
     base.Image = '@';
 }
Example #8
0
 private bool IsBrick(Position newPosition)
 {
     return space[newPosition] is Brick;
 }
Example #9
0
 private bool IsFreeSpace(Position newPosition)
 {
     return space[newPosition] is FreeSpace;
 }
Example #10
0
        private void MoveToFreeSpace(int i, Position newPosition)
        {
            locker.WaitOne();
            balls[i].Position = newPosition;

            SendChanges(this, new SendEventArgs(layer));

            locker.Release();
        }
Example #11
0
        private void RemoveBrick(Position newPosition)
        {
            locker.WaitOne();
            layer.RemoveBrick(newPosition);
            SendChanges(this, new SendEventArgs(layer));

            locker.Release();
        }
Example #12
0
 public FreeSpace(Position position)
 {
     base.Position = position;
     base.Image = ' ';
 }
Example #13
0
 public void RemoveBrickElement(Position position)
 {
     for (int i = 0; i < bricks.Count; i++)
     {
         if (bricks[i].Position == position)
         {
             Bricks.Remove(bricks[i]);
         }
     }
 }
Example #14
0
 public Brick(Position position)
 {
     base.Position = position;
     base.Image = '#';
 }