/// <summary> /// Apply a random direction to a location. /// </summary> /// <param name="aLocation">The location to apply a random direction to.</param> public static void ApplyTo(Location2i aLocation) { switch (RandomDirection.Get) { case Direction.Up: aLocation.Y--; break; case Direction.Right: aLocation.X++; break; case Direction.Down: aLocation.Y++; break; case Direction.Left: aLocation.X--; break; } }
/// <summary> /// CursorToLocation brings the cursor to the specified location. /// </summary> /// <param name="aLocation">The location to bring the cursor to.</param> public static void CursorToLocation(Location2i aLocation) { CursorToLocation(aLocation.X, aLocation.Y); }
public bool CheckBounds(Location2i l) { Location2i lLowerRight = new Location2i(Width, Height); if (l < Location2i.Origin2i) return false; else if (l >= lLowerRight) return false; return true; }
/// <summary> /// GetTile /// </summary> /// <param name="l"></param> /// <param name="d"></param> /// <returns></returns> public Tile GetTile(Location2i l, int d) { return MapData[l.X, l.Y, d]; }
/// <summary> /// Creates a new buffered region. /// </summary> /// <param name="a">The first point used for form the region</param> /// <param name="b">The second point used to for the region.</param> public Rectangle(Location2i a, Location2i b) { P1 = a; P2 = b; }
/// <summary> /// Clears a render buffer location. /// </summary> /// <param name="l"></param> public void ClearLocation(Location2i l) { RenderBuffer[l.X, l.Y].G = '\0'; }
/// <summary> /// Creates a new buffered region. /// </summary> /// <param name="a">The first point used for form the region</param> /// <param name="b">The second point used to for the region.</param> public DisplayRegion(Location2i a, Location2i b) : base(a, b) { }
/// <summary> /// Creates a new dungeon region. /// </summary> /// <param name="a">The first point used for form the region</param> /// <param name="b">The second point used to for the region.</param> public DungeonRegion(Dungeon3 d, Location2i a, Location2i b) : base(a, b) { Dungeon = d; }