/// <summary> /// Target location is in our viewable rectangle? /// </summary> /// <param name="TargetLocation">The location.</param> /// <returns></returns> public bool InRange(FurrePosition TargetLocation) { return(StartLocation.X <= TargetLocation.X && StartLocation.Y <= TargetLocation.Y && EndLocation.Y >= TargetLocation.Y && EndLocation.X >= TargetLocation.X); }
/// <summary> /// Initialize from center point usually a furre position /// </summary> /// <param name="x"></param> /// <param name="y"></param> public void SetPosition(Base220 x, Base220 y) { furreLocation = new FurrePosition(x, y); int XoddOffset = 2; int YoddOffset = 0; if (IsOdd(furreLocation.Y)) { XoddOffset = 0; YoddOffset = 1; } StartLocation = new FurrePosition() { X = furreLocation.X - 8 + XoddOffset, Y = furreLocation.Y - 8 - 1 }; EndLocation = new FurrePosition() { X = FurreLocation.X + 14, Y = FurreLocation.Y + 17 + YoddOffset }; }
/// <summary> /// Initializes a new instance of the <see cref="ViewArea"/> class. /// </summary> /// <param name="location">The location.</param> public ViewArea(FurrePosition location) { SetPosition(location.X, location.Y); }
/// <summary> /// Initializes a new instance of the <see cref="ViewArea"/> class. /// </summary> public ViewArea() { FurreLocation = new FurrePosition(); }