-
Notifications
You must be signed in to change notification settings - Fork 36
Grid System
Several classes in GoRogue, as an aggregate, act to represent and assist with operations on a grid.
The Coord class represents a point on a 2D grid. It provides the capability to efficiently storing and retrieving these values, as well as various operators and utility functions to assist with position-related math/operations.
The Direction class provides a convenient representation of "directions" on a grid; up, down, left, right, up_right, etc. It defines the "coordinate plane", provides operators that allow Directions to interact with Coords in convenient ways, and as well offers various utility functions that assist with direction-related math/operations.
GoRogue provides convenient methods to get the neighboring grid locations of a given location, via the AdjacencyRule class. This class also provides methods to get the Direction instances that lead to neighbors.
GoRogue also offers implementations of common grid-based line-drawing/line-creation algorithms, such as Bresenham's, Digital Differential Analyzer line-drawing, and an orthogonal-direction based line drawing algorithm.
The Distance class provides a way to represent various possible methods of calculating distance. It provides instances for manhattan, chebyshev, and euclidean distance. Each instance has functions that allow using the represented distance calculation to calculate the distance between two points.
The Radius class allows defining a "shape" that constitutes a radius (circle, square, diamond, etc). Radius instances interact with both Distance and AdjacencyRule instances to provide a convenient way to specify shapes for algorithms like FOV.
The Rectangle class provides an efficient way to represent a rectangular portion of a grid. It provides many different ways to create such a rectangle, as well as helpful operations that can prove useful in bounds checking and even map generation.
The RadiusAreaProvider class provides a convenient way to all retrieve locations inside a radius of a given size and shape.
- Home
- Getting Started
- GoRogue 1.0 to 2.0 Upgrade Guide
- Grid System
- Dice Rolling
- Effects System
- Field of View
- Map Generation (docs coming soon)
- Map View System
- Pathfinding (docs coming soon)
- Random Number Generation (docs coming soon)
- Sense Mapping (docs coming soon)
- Spatial Maps (docs coming soon)
- Utility/Miscellaneous (docs coming soon)