Skip to content

Instantly share code, notes, and snippets.

@saschagehlich
Created July 22, 2014 11:31
Show Gist options
  • Save saschagehlich/229ab3060c88a3342d41 to your computer and use it in GitHub Desktop.
Save saschagehlich/229ab3060c88a3342d41 to your computer and use it in GitHub Desktop.
// Tile.cpp
int* Tile::getWalkable()
{
int* walkable = new int[4];
walkable[0] = 1;
walkable[0] = 1;
walkable[0] = 1;
return walkable;
}
// Some other file
int* walkable = tile->getWalkable();
myPathfindingNode->setWalkable(walkable);
// PathfindingNode.cpp
void setWalkable(int* walkable)
{
mWalkable[0] = walkable[0];
mWalkable[1] = walkable[1];
mWalkable[2] = walkable[2];
mWalkable[3] = walkable[3];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment