private void TryDirectionRight(Cell cell) { if (cell.GetBoundingRect().Left > this.GetBoundingRect().Left) { _direction = Direction.Right; } }
private void TryDirectionLeft(Cell cell) { if (cell.GetBoundingRect().Left < this.GetBoundingRect().Left) { _direction = Direction.Left; } }
private void TryDirectionDown(Cell cell) { if (cell.GetBoundingRect().Top > this.GetBoundingRect().Top) { _direction = Direction.Down; } }
private void TryDirectionUp(Cell cell) { if (cell.GetBoundingRect().Top < this.GetBoundingRect().Top) { _direction = Direction.Up; } }
private bool MoveTo(Cell cell) { #region Validation if (cell == null) { throw new ArgumentNullException(); } #endregion TrySlowerSpeed(); UpdateDirection(cell); if (GetBoundingRect() != cell.GetBoundingRect()) { // Review IM : base.Move() this.Move(); return(false); } else { _direction = Direction.None; _speed = _fullSpeed; return(true); } }
private bool IsAtStart() { return(CurrentCell().GetBoundingRect() == _startCell.GetBoundingRect()); }
private bool IsInCell(Cell cell) { return(GetBoundingRect() == cell.GetBoundingRect()); }