AzerothCore 3.3.5a OpenSource WoW Emulator
Searching...
No Matches
RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::Cell Struct Reference

`#include "RegularGrid.h"`

## Public Member Functions

bool operator== (const Cell &c2) const

bool isValid () const

## Static Public Member Functions

static Cell ComputeCell (float fx, float fy)

int x

int y

## Detailed Description

template<class T, class Node, class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
struct RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::Cell

## ◆ ComputeCell()

template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
 static Cell RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::Cell::ComputeCell ( float fx, float fy )
inlinestatic
152 {
153 Cell c = { int(fx * (1.f / CELL_SIZE) + (CELL_NUMBER / 2)), int(fy * (1.f / CELL_SIZE) + (CELL_NUMBER / 2)) };
154 return c;
155 }
#define CELL_SIZE
Definition: RegularGrid.h:53
@ CELL_NUMBER
Definition: RegularGrid.h:49
Definition: Cell.h:46

## ◆ isValid()

template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
 bool RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::Cell::isValid ( ) const
inline
157{ return x >= 0 && x < CELL_NUMBER && y >= 0 && y < CELL_NUMBER;}
int x
Definition: RegularGrid.h:148
int y
Definition: RegularGrid.h:148

## ◆ operator==()

template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
 bool RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::Cell::operator== ( const Cell & c2 ) const
inline
149{ return x == c2.x && y == c2.y;}

## ◆ x

template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
 int RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::Cell::x

## ◆ y

template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
 int RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::Cell::y