diff --git a/generators/anselme.cpp b/generators/anselme.cpp index a79fd4f..4d36f79 100644 --- a/generators/anselme.cpp +++ b/generators/anselme.cpp @@ -7,25 +7,25 @@ extern "C" void generate(Map *mapPtr) { - Map &map = *mapPtr; - int w = map.getWidth(); - int h = map.getHeight(); - int n = map.getNbTeams(); - int i, j, k; + Map &map = *mapPtr; + int w = map.getWidth(); + int h = map.getHeight(); + int n = map.getNbTeams(); + int i, j, k; - for(i=0; i +#include +#include +#include + +// g++ -shared test_library.cpp -o test_library.so -I../src -fPIC + +extern "C" void generate(Map *mapPtr) +{ + Map &map = *mapPtr; + int w = map.getWidth(); + int h = map.getHeight(); + int n = map.getNbTeams(); + int i, j, k; + + for(i=0;iteam(i) + Coord(Dir(rand()%4)); - std::cout << p_map->getPixel(spawnPos).type << std::endl; if(PixelProperty::isWalkable(p_map->getPixel(spawnPos).type)) { Dude *dude = new Dude(spawnPos,p_map,i); (*p_map)[spawnPos].data.dudePtr = dude; p_map->updatePixel(spawnPos); m_dudes.push_back(dude); - } + }/* else - std::cout << "Unpopable" << std::endl; - // TODO check other case or delay the spawning + // TODO check other case or delay the spawning*/ } } } @@ -213,8 +211,6 @@ void Simulation::handleAction(const Action &action, Dude *dude) } else{ target.writeBook(action.com_data); - // TODO: understand what the fuck this line is doing bis - //memcpy(target.data.knowledge + action->com_data.flag, action->com_data.data, COM_SIZE); dude->setSuccess(true); } break;