A Neighborhood is a description of all neighbors for a single cube, packed into a small value. More...
#include <sifteo/cube.h>
Public Member Functions | |
CubeID | cubeAt (Side side) const |
Return the neighbor at a particular side, as a CubeID. More... | |
bool | hasCubeAt (Side side) const |
Is there a cube at this side? This is equivalent to calling isCube() on the result of neighborAt(). | |
bool | hasNeighborAt (Side side) const |
Is there a neighbor at this side? This is equivalent to calling !isEmpty() on the result of neighborAt(). | |
NeighborID | neighborAt (Side side) const |
Return the neighbor at a particular side, as a NeighborID. | |
Neighborhood () | |
Default constructor. Leaves the Neighborhood uninitialized. | |
Neighborhood (_SYSNeighborState sys) | |
Initialize a Neighborhood from a low-level _SYSNeighborState object. | |
Neighborhood (CubeID cube) | |
Get a Neighborhood representing the physical neighbors for a cube. More... | |
operator _SYSNeighborState & () | |
Implicit conversion to _SYSNeighborState, for use in low-level system calls. | |
Side | sideOf (CubeID cube) const |
Search for a CubeID in this Neighborhood. More... | |
A Neighborhood is a description of all neighbors for a single cube, packed into a small value.
Each side can be empty, or it can refer to another cube by its CubeID.
|
inline |
Get a Neighborhood representing the physical neighbors for a cube.
The sides in this Neighborhood are relative to the physical cube hardware, not to the current screen orientation. (A CubeID object has no way of knowing what the current screen orientation is.)
Search for a CubeID in this Neighborhood.
If the specified cube is part of this neighborhood (i.e. it was neighbored to the cube that this Neighborhood was created for), return the Side where that cube is found. Otherwise, returns NO_SIDE.
Sifteo SDK v1.1.0 (see all versions)
Last updated Tue Dec 23 2014, by Doxygen