Skip to content

Instantly share code, notes, and snippets.

@lorinbeer
Created March 19, 2010 22:43
Show Gist options
  • Save lorinbeer/338280 to your computer and use it in GitHub Desktop.
Save lorinbeer/338280 to your computer and use it in GitHub Desktop.
//add actor doesn't have the desired effect unless the tile can be passed as a reference, but there doesn't seem to be a way to do that
void addActor( igsTile tile ) { tile.activateModule( MODULE_ACTOR ); }
igsDungeonMap::igsDungeonMap(int x, int y):
m_iMapID(0),
m_dungeon(),
m_players(),
m_mobs(),
m_items()
{
m_dungeon.resize( x );
TYPE_2D_TILE_VECTOR::iterator it = m_dungeon.begin();
while( it != m_dungeon.end() ) {
it->resize( y );
for_each( it->begin(), it->end(), &igsDungeonMap::addActor );
it++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment