public IBorderable GetBorder(Position position) { if (GetBorderOfY(position) is BorderInside) //Border.Inside) { return GetBorderOfX(position); } return GetBorderOfY(position); }
private IBorderable GetBorderOfX(Position position) { if (position.X >= 0) { if (position.X < LONG - 1) { return new BorderInside(); } else { return new BorderRight(); } } return new BorderLeft(); }
public AbstractEntity this[Position position] { get { return space[position.Y,position.X]; } }
public Ball(Position position, string name) { base.Position = position; base.Image = 'o'; this.Name = name; }
private IBorderable GetBorderOfY(Position position) { if (position.Y >= 0) { if (position.Y <= HIGH - 1) { return new BorderInside(); } else { return new BorderBottom(); } } return new BorderTop(); }
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); } }
public PlatformElement(Position position) { base.Position = position; base.Image = '@'; }
private bool IsBrick(Position newPosition) { return space[newPosition] is Brick; }
private bool IsFreeSpace(Position newPosition) { return space[newPosition] is FreeSpace; }
private void MoveToFreeSpace(int i, Position newPosition) { locker.WaitOne(); balls[i].Position = newPosition; SendChanges(this, new SendEventArgs(layer)); locker.Release(); }
private void RemoveBrick(Position newPosition) { locker.WaitOne(); layer.RemoveBrick(newPosition); SendChanges(this, new SendEventArgs(layer)); locker.Release(); }
public FreeSpace(Position position) { base.Position = position; base.Image = ' '; }
public void RemoveBrickElement(Position position) { for (int i = 0; i < bricks.Count; i++) { if (bricks[i].Position == position) { Bricks.Remove(bricks[i]); } } }
public Brick(Position position) { base.Position = position; base.Image = '#'; }