header_utils
Loading...
Searching...
No Matches
ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE > Struct Template Reference

A container for squares in a 2D square grid. More...

#include <square_grid.h>

Public Types

enum class  iteration_flags { with_self , only_valid , diagonals }
using tile_data_type

Public Member Functions

 grid (int w, int h, TILE_DATA const &default_tile)
 grid (glm::ivec2 size, TILE_DATA const &default_tile)
 grid (int w, int h)
 grid (glm::ivec2 size)
void reset (int w, int h, TILE_DATA const &default_tile)
void reset (int w, int h, std::vector< TILE_DATA > tiles)
void reset (int w, int h)
void reset (glm::ivec2 size)
void reset (glm::ivec2 size, TILE_DATA const &default_tile)
template<change_tile_callback< TILE_DATA > TILE_RESET_FUNC>
requires RESIZABLE
void reset_from (glm::ivec2 size, TILE_RESET_FUNC &&tile_reset)
TILE_DATA & operator[] (int i)
 Accessors & Queries.
TILE_DATA const & operator[] (int i) const
TILE_DATA & operator[] (glm::ivec2 v)
TILE_DATA const & operator[] (glm::ivec2 v) const
bool is_valid (int x, int y) const noexcept
bool is_valid (glm::vec2 world_pos, glm::vec2 tile_size) const noexcept
bool is_valid (glm::ivec2 pos) const noexcept
bool is_index_valid (int index) const noexcept
bool is_valid (int x, int y, int edge_width) const noexcept
bool is_valid (glm::vec2 world_pos, glm::vec2 tile_size, int edge_width) const noexcept
bool is_valid (glm::ivec2 pos, int edge_width) const noexcept
int index (int x, int y) const noexcept
int index (glm::ivec2 pos) const noexcept
int valid_index (int x, int y) const noexcept
int valid_index (glm::ivec2 pos) const noexcept
TILE_DATA const * at (glm::ivec2 pos) const noexcept
TILE_DATA const * at (int x, int y) const noexcept
TILE_DATA * at (glm::ivec2 pos) noexcept
TILE_DATA * at (int x, int y) noexcept
TILE_DATA const * at_index (int index) const noexcept
TILE_DATA * at_index (int index) noexcept
TILE_DATA const & safe_at (glm::ivec2 pos, TILE_DATA const &outside) const noexcept
TILE_DATA const & safe_at (int x, int y, TILE_DATA const &outside) const noexcept
TILE_DATA & safe_at (glm::ivec2 pos, TILE_DATA &outside) noexcept
TILE_DATA & safe_at (int x, int y, TILE_DATA &outside) noexcept
int width () const noexcept
int height () const noexcept
glm::ivec2 size () const noexcept
irec2 perimeter () const noexcept
irec2 bounds () const noexcept
rec2 bounds (glm::vec2 tile_size) const noexcept
std::span< TILE_DATA const > tiles () const
std::span< TILE_DATA > tiles ()
size_t tile_count () const noexcept
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::with_self, iteration_flags::only_valid }>
auto for_each_neighbor (glm::ivec2 of, change_tile_callback< TILE_DATA > auto &&func)
 TODO: set_* functions that mirror for_each_*, e.g. set_rect(rect, tile);.
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::with_self, iteration_flags::only_valid }>
auto for_each_selected_neighbor (glm::ivec2 of, direction_set neighbor_set, change_tile_callback< TILE_DATA > auto &&func)
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }>
auto for_each_tile_in_rect (irec2 const &tile_rect, change_tile_callback< TILE_DATA > auto &&func)
 TODO: deduce thos.
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }>
auto for_each_tile_in_perimeter (irec2 const &tile_rect, change_tile_callback< TILE_DATA > auto &&func)
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }, typename TILE_SET>
auto for_each_tile_in_set (TILE_SET &&tiles, change_tile_callback< TILE_DATA > auto &&func)
template<change_tile_callback< TILE_DATA > FUNC>
auto for_each_tile (FUNC &&func)
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }>
auto for_each_tile_in_polygon (std::span< glm::vec2 const > poly_points, glm::vec2 tile_size, change_tile_callback< TILE_DATA > auto &&func)
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }, typename FUNC>
auto for_each_tile_in_row (int row, FUNC &&func)
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }, typename FUNC>
auto for_each_tile_in_column (int column, FUNC &&func)
template<query_tile_callback< TILE_DATA > FUNC>
bool line_cast (glm::ivec2 start, glm::ivec2 end, FUNC &&blocks_func, bool ignore_start) const
 Returns whether the (bresenham) line between start and end is free of blocking tiles, as determined by blocks_func.
template<bool ONLY_VALID = true, change_tile_callback< TILE_DATA > FUNC>
auto apply (glm::ivec2 to, FUNC &&func)
 Modifiers.
template<bool ONLY_VALID = true, tile_callback< TILE_DATA > FUNC>
auto apply (glm::ivec2 to, FUNC &&func) const
void flip_row (int row)
void flip_horizontal ()
void flip_vertical ()
void rotate_row (int row, int by)
void rotate_column (int column, int by)
void shift_row (int row, int by, TILE_DATA const &add_tile)
void shift_column (int column, int by, TILE_DATA const &add_tile)
void rotate_rows (int by)
void rotate_columns (int by)
void shift_rows (int by, TILE_DATA const &add_tile)
void shift_columns (int by, TILE_DATA const &add_tile)
void rotate_180 ()
void resize (glm::uvec2 new_size, const TILE_DATA &new_element)
void resize (glm::uvec2 new_size)
void resize (int w, int h)
void clear ()
void clear (TILE_DATA const &to)

Static Public Attributes

static constexpr bool resizable

Protected Member Functions

auto GetRowStart (int row)
auto GetTileIterator (int x, int y)
void Reset (int w, int h, TILE_DATA const &default_tile)
template<change_tile_callback< TILE_DATA > TILE_RESET_FUNC>
void Reset (int w, int h, TILE_RESET_FUNC &&tile_reset)
void Reset (int w, int h)
void Reset (int w, int h, std::vector< TILE_DATA > tiles)
void ResizeY (int new_y, const TILE_DATA &new_element)
void ResizeX (int new_x, const TILE_DATA &new_element)

Protected Attributes

int mWidth
int mHeight
std::vector< TILE_DATA > mTiles

Detailed Description

template<typename TILE_DATA, bool RESIZABLE = true>
struct ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >

A container for squares in a 2D square grid.

Definition at line 42 of file square_grid.h.

Member Typedef Documentation

◆ tile_data_type

template<typename TILE_DATA, bool RESIZABLE = true>
using ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::tile_data_type

Definition at line 47 of file square_grid.h.

Member Enumeration Documentation

◆ iteration_flags

template<typename TILE_DATA, bool RESIZABLE = true>
enum class ghassanpl::geometry::squares::grid::iteration_flags
strong

Definition at line 120 of file square_grid.h.

Constructor & Destructor Documentation

◆ grid() [1/4]

template<typename TILE_DATA, bool RESIZABLE = true>
ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::grid ( int w,
int h,
TILE_DATA const & default_tile )
inline

Definition at line 50 of file square_grid.h.

◆ grid() [2/4]

template<typename TILE_DATA, bool RESIZABLE = true>
ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::grid ( glm::ivec2 size,
TILE_DATA const & default_tile )
inline

Definition at line 51 of file square_grid.h.

◆ grid() [3/4]

template<typename TILE_DATA, bool RESIZABLE = true>
ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::grid ( int w,
int h )
inline

Definition at line 52 of file square_grid.h.

◆ grid() [4/4]

template<typename TILE_DATA, bool RESIZABLE = true>
ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::grid ( glm::ivec2 size)
inlineexplicit

Definition at line 53 of file square_grid.h.

Member Function Documentation

◆ apply() [1/2]

template<typename TILE_DATA, bool RESIZABLE = true>
template<bool ONLY_VALID = true, change_tile_callback< TILE_DATA > FUNC>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::apply ( glm::ivec2 to,
FUNC && func )
inline

Modifiers.

Definition at line 367 of file square_grid.h.

◆ apply() [2/2]

template<typename TILE_DATA, bool RESIZABLE = true>
template<bool ONLY_VALID = true, tile_callback< TILE_DATA > FUNC>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::apply ( glm::ivec2 to,
FUNC && func ) const
inline

Definition at line 382 of file square_grid.h.

◆ at() [1/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA const * ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::at ( glm::ivec2 pos) const
inlinenodiscardnoexcept

Definition at line 92 of file square_grid.h.

◆ at() [2/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA * ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::at ( glm::ivec2 pos)
inlinenodiscardnoexcept

Definition at line 94 of file square_grid.h.

◆ at() [3/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA const * ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::at ( int x,
int y ) const
inlinenodiscardnoexcept

Definition at line 93 of file square_grid.h.

◆ at() [4/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA * ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::at ( int x,
int y )
inlinenodiscardnoexcept

Definition at line 95 of file square_grid.h.

◆ at_index() [1/2]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA const * ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::at_index ( int index) const
inlinenodiscardnoexcept

Definition at line 96 of file square_grid.h.

◆ at_index() [2/2]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA * ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::at_index ( int index)
inlinenodiscardnoexcept

Definition at line 97 of file square_grid.h.

◆ bounds() [1/2]

template<typename TILE_DATA, bool RESIZABLE = true>
irec2 ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::bounds ( ) const
inlinenodiscardnoexcept

Definition at line 108 of file square_grid.h.

◆ bounds() [2/2]

template<typename TILE_DATA, bool RESIZABLE = true>
rec2 ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::bounds ( glm::vec2 tile_size) const
inlinenodiscardnoexcept

Definition at line 109 of file square_grid.h.

◆ clear() [1/2]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::clear ( )
inline

Definition at line 469 of file square_grid.h.

◆ clear() [2/2]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::clear ( TILE_DATA const & to)
inline

Definition at line 470 of file square_grid.h.

◆ flip_horizontal()

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::flip_horizontal ( )
inline

Definition at line 401 of file square_grid.h.

◆ flip_row()

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::flip_row ( int row)
inline

Definition at line 395 of file square_grid.h.

◆ flip_vertical()

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::flip_vertical ( )
inline

Definition at line 407 of file square_grid.h.

◆ for_each_neighbor()

template<typename TILE_DATA, bool RESIZABLE = true>
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::with_self, iteration_flags::only_valid }>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::for_each_neighbor ( glm::ivec2 of,
change_tile_callback< TILE_DATA > auto && func )
inline

TODO: set_* functions that mirror for_each_*, e.g. set_rect(rect, tile);.

Definition at line 130 of file square_grid.h.

◆ for_each_selected_neighbor()

template<typename TILE_DATA, bool RESIZABLE = true>
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::with_self, iteration_flags::only_valid }>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::for_each_selected_neighbor ( glm::ivec2 of,
direction_set neighbor_set,
change_tile_callback< TILE_DATA > auto && func )
inline

Definition at line 173 of file square_grid.h.

◆ for_each_tile()

template<typename TILE_DATA, bool RESIZABLE = true>
template<change_tile_callback< TILE_DATA > FUNC>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::for_each_tile ( FUNC && func)
inline

Definition at line 284 of file square_grid.h.

◆ for_each_tile_in_perimeter()

template<typename TILE_DATA, bool RESIZABLE = true>
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::for_each_tile_in_perimeter ( irec2 const & tile_rect,
change_tile_callback< TILE_DATA > auto && func )
inline

Definition at line 225 of file square_grid.h.

◆ for_each_tile_in_rect()

template<typename TILE_DATA, bool RESIZABLE = true>
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::for_each_tile_in_rect ( irec2 const & tile_rect,
change_tile_callback< TILE_DATA > auto && func )
inline

TODO: deduce thos.

Definition at line 200 of file square_grid.h.

◆ for_each_tile_in_set()

template<typename TILE_DATA, bool RESIZABLE = true>
template<enum_flags< iteration_flags > FLAGS = enum_flags<iteration_flags>{ iteration_flags::only_valid }, typename TILE_SET>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::for_each_tile_in_set ( TILE_SET && tiles,
change_tile_callback< TILE_DATA > auto && func )
inline

Definition at line 265 of file square_grid.h.

◆ GetRowStart()

template<typename TILE_DATA, bool RESIZABLE = true>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::GetRowStart ( int row)
inlineprotected

Definition at line 474 of file square_grid.h.

◆ GetTileIterator()

template<typename TILE_DATA, bool RESIZABLE = true>
auto ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::GetTileIterator ( int x,
int y )
inlineprotected

Definition at line 475 of file square_grid.h.

◆ height()

template<typename TILE_DATA, bool RESIZABLE = true>
int ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::height ( ) const
inlinenodiscardnoexcept

Definition at line 105 of file square_grid.h.

◆ index() [1/2]

template<typename TILE_DATA, bool RESIZABLE = true>
int ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::index ( glm::ivec2 pos) const
inlinenodiscardnoexcept

Definition at line 88 of file square_grid.h.

◆ index() [2/2]

template<typename TILE_DATA, bool RESIZABLE = true>
int ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::index ( int x,
int y ) const
inlinenodiscardnoexcept

Definition at line 87 of file square_grid.h.

◆ is_index_valid()

template<typename TILE_DATA, bool RESIZABLE = true>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::is_index_valid ( int index) const
inlinenodiscardnoexcept

Definition at line 81 of file square_grid.h.

◆ is_valid() [1/6]

template<typename TILE_DATA, bool RESIZABLE = true>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::is_valid ( glm::ivec2 pos) const
inlinenodiscardnoexcept

Definition at line 80 of file square_grid.h.

◆ is_valid() [2/6]

template<typename TILE_DATA, bool RESIZABLE = true>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::is_valid ( glm::ivec2 pos,
int edge_width ) const
inlinenodiscardnoexcept

Definition at line 85 of file square_grid.h.

◆ is_valid() [3/6]

template<typename TILE_DATA, bool RESIZABLE = true>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::is_valid ( glm::vec2 world_pos,
glm::vec2 tile_size ) const
inlinenodiscardnoexcept

Definition at line 79 of file square_grid.h.

◆ is_valid() [4/6]

template<typename TILE_DATA, bool RESIZABLE = true>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::is_valid ( glm::vec2 world_pos,
glm::vec2 tile_size,
int edge_width ) const
inlinenodiscardnoexcept

Definition at line 84 of file square_grid.h.

◆ is_valid() [5/6]

template<typename TILE_DATA, bool RESIZABLE = true>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::is_valid ( int x,
int y ) const
inlinenodiscardnoexcept

Definition at line 78 of file square_grid.h.

◆ is_valid() [6/6]

template<typename TILE_DATA, bool RESIZABLE = true>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::is_valid ( int x,
int y,
int edge_width ) const
inlinenodiscardnoexcept

Definition at line 83 of file square_grid.h.

◆ line_cast()

template<typename TILE_DATA, bool RESIZABLE = true>
template<query_tile_callback< TILE_DATA > FUNC>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::line_cast ( glm::ivec2 start,
glm::ivec2 end,
FUNC && blocks_func,
bool ignore_start ) const
inline

Returns whether the (bresenham) line between start and end is free of blocking tiles, as determined by blocks_func.

Definition at line 301 of file square_grid.h.

◆ operator[]() [1/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA & ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::operator[] ( glm::ivec2 v)
inlinenodiscard

Definition at line 75 of file square_grid.h.

◆ operator[]() [2/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA const & ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::operator[] ( glm::ivec2 v) const
inlinenodiscard

Definition at line 76 of file square_grid.h.

◆ operator[]() [3/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA & ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::operator[] ( int i)
inlinenodiscard

Accessors & Queries.

Definition at line 67 of file square_grid.h.

◆ operator[]() [4/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA const & ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::operator[] ( int i) const
inlinenodiscard

Definition at line 68 of file square_grid.h.

◆ perimeter()

template<typename TILE_DATA, bool RESIZABLE = true>
irec2 ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::perimeter ( ) const
inlinenodiscardnoexcept

Definition at line 107 of file square_grid.h.

◆ Reset() [1/4]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::Reset ( int w,
int h )
inlineprotected

Definition at line 502 of file square_grid.h.

◆ Reset() [2/4]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::Reset ( int w,
int h,
std::vector< TILE_DATA > tiles )
inlineprotected

Definition at line 513 of file square_grid.h.

◆ Reset() [3/4]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::Reset ( int w,
int h,
TILE_DATA const & default_tile )
inlineprotected

Definition at line 477 of file square_grid.h.

◆ Reset() [4/4]

template<typename TILE_DATA, bool RESIZABLE = true>
template<change_tile_callback< TILE_DATA > TILE_RESET_FUNC>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::Reset ( int w,
int h,
TILE_RESET_FUNC && tile_reset )
inlineprotected

Definition at line 489 of file square_grid.h.

◆ reset() [1/5]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::reset ( glm::ivec2 size)
inline

Definition at line 59 of file square_grid.h.

◆ reset() [2/5]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::reset ( glm::ivec2 size,
TILE_DATA const & default_tile )
inline

Definition at line 60 of file square_grid.h.

◆ reset() [3/5]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::reset ( int w,
int h )
inline

Definition at line 57 of file square_grid.h.

◆ reset() [4/5]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::reset ( int w,
int h,
std::vector< TILE_DATA > tiles )
inline

Definition at line 56 of file square_grid.h.

◆ reset() [5/5]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::reset ( int w,
int h,
TILE_DATA const & default_tile )
inline

Definition at line 55 of file square_grid.h.

◆ reset_from()

template<typename TILE_DATA, bool RESIZABLE = true>
template<change_tile_callback< TILE_DATA > TILE_RESET_FUNC>
requires RESIZABLE
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::reset_from ( glm::ivec2 size,
TILE_RESET_FUNC && tile_reset )
inline

Definition at line 63 of file square_grid.h.

◆ resize() [1/3]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::resize ( glm::uvec2 new_size)
inline

Definition at line 456 of file square_grid.h.

◆ resize() [2/3]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::resize ( glm::uvec2 new_size,
const TILE_DATA & new_element )
inline

Definition at line 450 of file square_grid.h.

◆ resize() [3/3]

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::resize ( int w,
int h )
inline

Definition at line 462 of file square_grid.h.

◆ ResizeX()

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::ResizeX ( int new_x,
const TILE_DATA & new_element )
inlineprotected

Definition at line 534 of file square_grid.h.

◆ ResizeY()

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::ResizeY ( int new_y,
const TILE_DATA & new_element )
inlineprotected

Definition at line 525 of file square_grid.h.

◆ rotate_180()

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::rotate_180 ( )
inline

Definition at line 440 of file square_grid.h.

◆ safe_at() [1/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA & ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::safe_at ( glm::ivec2 pos,
TILE_DATA & outside )
inlinenodiscardnoexcept

Definition at line 101 of file square_grid.h.

◆ safe_at() [2/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA const & ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::safe_at ( glm::ivec2 pos,
TILE_DATA const & outside ) const
inlinenodiscardnoexcept

Definition at line 99 of file square_grid.h.

◆ safe_at() [3/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA & ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::safe_at ( int x,
int y,
TILE_DATA & outside )
inlinenodiscardnoexcept

Definition at line 102 of file square_grid.h.

◆ safe_at() [4/4]

template<typename TILE_DATA, bool RESIZABLE = true>
TILE_DATA const & ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::safe_at ( int x,
int y,
TILE_DATA const & outside ) const
inlinenodiscardnoexcept

Definition at line 100 of file square_grid.h.

◆ shift_rows()

template<typename TILE_DATA, bool RESIZABLE = true>
void ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::shift_rows ( int by,
TILE_DATA const & add_tile )
inline

Definition at line 422 of file square_grid.h.

◆ size()

template<typename TILE_DATA, bool RESIZABLE = true>
glm::ivec2 ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::size ( ) const
inlinenodiscardnoexcept

Definition at line 106 of file square_grid.h.

◆ tile_count()

template<typename TILE_DATA, bool RESIZABLE = true>
size_t ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::tile_count ( ) const
inlinenodiscardnoexcept

Definition at line 112 of file square_grid.h.

◆ tiles() [1/2]

template<typename TILE_DATA, bool RESIZABLE = true>
std::span< TILE_DATA > ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::tiles ( )
inlinenodiscard

Definition at line 111 of file square_grid.h.

◆ tiles() [2/2]

template<typename TILE_DATA, bool RESIZABLE = true>
std::span< TILE_DATA const > ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::tiles ( ) const
inlinenodiscard

Definition at line 110 of file square_grid.h.

◆ valid_index() [1/2]

template<typename TILE_DATA, bool RESIZABLE = true>
int ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::valid_index ( glm::ivec2 pos) const
inlinenodiscardnoexcept

Definition at line 90 of file square_grid.h.

◆ valid_index() [2/2]

template<typename TILE_DATA, bool RESIZABLE = true>
int ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::valid_index ( int x,
int y ) const
inlinenodiscardnoexcept

Definition at line 89 of file square_grid.h.

◆ width()

template<typename TILE_DATA, bool RESIZABLE = true>
int ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::width ( ) const
inlinenodiscardnoexcept

Definition at line 104 of file square_grid.h.

Member Data Documentation

◆ mHeight

template<typename TILE_DATA, bool RESIZABLE = true>
int ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::mHeight
protected

Definition at line 585 of file square_grid.h.

◆ mTiles

template<typename TILE_DATA, bool RESIZABLE = true>
std::vector<TILE_DATA> ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::mTiles
protected

Definition at line 586 of file square_grid.h.

◆ mWidth

template<typename TILE_DATA, bool RESIZABLE = true>
int ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::mWidth
protected

Definition at line 584 of file square_grid.h.

◆ resizable

template<typename TILE_DATA, bool RESIZABLE = true>
bool ghassanpl::geometry::squares::grid< TILE_DATA, RESIZABLE >::resizable
staticconstexpr

Definition at line 46 of file square_grid.h.