SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
TerrainRectangleArea Class Reference

Represents a rectangular area of terrain cells for iteration. More...

#include <TerrainRectangleArea.h>

Classes

class  Iterator
 Iterator for traversing terrain cells in a rectangular area. More...
 

Public Member Functions

 TerrainRectangleArea (const Terrain *terrain, int xStart, int zStart, int xEnd, int zEnd)
 Constructs a rectangular area for iteration.
 
Iterator begin () const
 Returns an iterator to the beginning of the area.
 
Iterator end () const
 Returns an iterator to the end of the area.
 

Private Attributes

const TerrainpTerrain
 Pointer to the terrain.
 
int xStart
 
int zStart
 
int xEnd
 
int zEnd
 Start and end indices.
 

Detailed Description

Represents a rectangular area of terrain cells for iteration.

The TerrainRectangleArea class allows iteration over a rectangular region of terrain cells, providing access to each cell's AABB and indices. Useful for spatial queries and collision checks.

Constructor & Destructor Documentation

◆ TerrainRectangleArea()

TerrainRectangleArea::TerrainRectangleArea ( const Terrain * terrain,
int xStart,
int zStart,
int xEnd,
int zEnd )

Constructs a rectangular area for iteration.

Parameters
terrainPointer to the Terrain.
xStartStarting X index.
zStartStarting Z index.
xEndEnding X index (inclusive).
zEndEnding Z index (inclusive).

Member Function Documentation

◆ begin()

TerrainRectangleArea::Iterator TerrainRectangleArea::begin ( ) const

Returns an iterator to the beginning of the area.

Returns
Iterator to the first cell.
Here is the caller graph for this function:

◆ end()

TerrainRectangleArea::Iterator TerrainRectangleArea::end ( ) const

Returns an iterator to the end of the area.

Returns
Iterator to one past the last cell.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: