std::vector<Actor*> SingleNeighbourSelector::select(std::function<bool (amarlon::Actor*)>* filterFun) { Engine::instance().gui().setStatusMessage( _selectionMessage ); TCODConsole::root->flush(); Map& map = Engine::instance().currentMap(); Actor* player = Actor::Player; int dx(0), dy(0); DirectionSelector dSelector; dSelector.select(dx, dy); Engine::instance().gui().clearStatusMessage(); Engine::instance().render(); return map.getActors(player->getX()+dx, player->getY()+dy, filterFun); }
Target SingleNeighbourSelector::select(std::function<bool (amarlon::ActorPtr)>* filterFun) { Engine::instance().gui().setStatusMessage( _selectionMessage ); TCODConsole::root->flush(); MapPtr map = Actor::Player->getMap(); ActorPtr player = Actor::Player; int dx(0), dy(0); DirectionSelector dSelector; dSelector.select(dx, dy); Engine::instance().gui().clearStatusMessage(); Engine::instance().render(); assert( map != nullptr ); return Target(map->getActors(player->getX()+dx, player->getY()+dy, filterFun), player->getX()+dx, player->getY()+dy); }