Exemplo n.º 1
0
 public IBorderable GetBorder(Position position)
 {
     if (GetBorderOfY(position) is BorderInside) //Border.Inside)
     {
        return GetBorderOfX(position);
     }
     return GetBorderOfY(position);
 }
Exemplo n.º 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();
 }
Exemplo n.º 3
0
 public AbstractEntity this[Position position]
 {
     get { return space[position.Y,position.X]; }
 }
Exemplo n.º 4
0
 public Ball(Position position, string name)
 {
     base.Position = position;
     base.Image = 'o';
     this.Name = name;
 }
Exemplo n.º 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();
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 7
0
 public PlatformElement(Position position)
 {
     base.Position = position;
     base.Image = '@';
 }
Exemplo n.º 8
0
 private bool IsBrick(Position newPosition)
 {
     return space[newPosition] is Brick;
 }
Exemplo n.º 9
0
 private bool IsFreeSpace(Position newPosition)
 {
     return space[newPosition] is FreeSpace;
 }
Exemplo n.º 10
0
        private void MoveToFreeSpace(int i, Position newPosition)
        {
            locker.WaitOne();
            balls[i].Position = newPosition;

            SendChanges(this, new SendEventArgs(layer));

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

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