Skip to content

Instantly share code, notes, and snippets.

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