Gamedev Framework (gf)  0.7.0
A C++14 framework for 2D games
Public Member Functions | Public Attributes | List of all members
gf::PositionRange< T >::Iterator Struct Reference

An iterator for a 2D range. More...

#include <gf/Range.h>

Inheritance diagram for gf::PositionRange< T >::Iterator:
Inheritance graph
[legend]

Public Member Functions

constexpr Iterator (Range< T > iteratorRange, Vector< T, 2 > iteratorPosition) noexcept
 Constructor. More...
 
Vector< T, 2 > operator* () noexcept
 Dereference operator. More...
 
Iteratoroperator++ () noexcept
 Increment operator (prefix) More...
 
Iterator operator++ (int) noexcept
 Increment operator (postfix) More...
 
constexpr bool operator!= (const Iterator &other) const noexcept
 Inequality operator. More...
 
constexpr bool operator== (const Iterator &other) const noexcept
 Equality operator. More...
 

Public Attributes

Range< Trange
 
Vector< T, 2 > position
 

Detailed Description

template<typename T>
struct gf::PositionRange< T >::Iterator

An iterator for a 2D range.

Constructor & Destructor Documentation

◆ Iterator()

template<typename T>
constexpr gf::PositionRange< T >::Iterator::Iterator ( Range< T iteratorRange,
Vector< T, 2 >  iteratorPosition 
)
inlinenoexcept

Constructor.

Parameters
iteratorRangeThe range in the first dimension
iteratorPositionThe current position in 2D

Member Function Documentation

◆ operator!=()

template<typename T>
constexpr bool gf::PositionRange< T >::Iterator::operator!= ( const Iterator other) const
inlinenoexcept

Inequality operator.

Parameters
otherAnother iterator
Returns
True if the iterator are different

◆ operator*()

template<typename T>
Vector<T, 2> gf::PositionRange< T >::Iterator::operator* ( )
inlinenoexcept

Dereference operator.

Returns
The position

◆ operator++() [1/2]

template<typename T>
Iterator& gf::PositionRange< T >::Iterator::operator++ ( )
inlinenoexcept

Increment operator (prefix)

Returns
The iterator

◆ operator++() [2/2]

template<typename T>
Iterator gf::PositionRange< T >::Iterator::operator++ ( int  )
inlinenoexcept

Increment operator (postfix)

Returns
The iterator

◆ operator==()

template<typename T>
constexpr bool gf::PositionRange< T >::Iterator::operator== ( const Iterator other) const
inlinenoexcept

Equality operator.

Parameters
otherAnother iterator
Returns
True if the iterator are the same

Member Data Documentation

◆ position

template<typename T>
Vector<T, 2> gf::PositionRange< T >::Iterator::position

◆ range

template<typename T>
Range<T> gf::PositionRange< T >::Iterator::range