Files
GDevelop/Core/GDCore/IDE/Events/EventsRemover.h
Florian Rival a8559bfbbc Add clang-format to format (C++) source files automatically (#491)
* Update all CMakeLists of extensions to use clang-format
* Run clang-format on all Extensions
* Update GDCore CMakeLists.txt to add clang-format
* Run clang-format on GDCore files
* Update GDJS and GDCpp CMakeLists.txt to add clang-format
* Run clang-format on GDCpp and GDJS files
2018-05-09 15:57:38 -07:00

56 lines
1.3 KiB
C++

/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef EventsRemover_H
#define EventsRemover_H
#include <set>
#include <vector>
#include "GDCore/IDE/Events/ArbitraryEventsWorker.h"
#include "GDCore/String.h"
namespace gd {
class BaseEvent;
}
namespace gd {
class Project;
}
namespace gd {
class EventsList;
}
namespace gd {
/**
* \brief List the values of the parameters of events and their type.
*
* \ingroup IDE
*/
class GD_CORE_API EventsRemover : public ArbitraryEventsWorker {
public:
EventsRemover(){};
virtual ~EventsRemover();
void AddEventToRemove(gd::BaseEvent &event) { eventsToRemove.insert(&event); }
void AddInstructionToRemove(gd::Instruction &instruction) {
instructionsToRemove.insert(&instruction);
}
private:
virtual bool DoVisitEvent(gd::BaseEvent &event) {
return eventsToRemove.count(&event) != 0;
}
virtual bool DoVisitInstruction(gd::Instruction &instruction,
bool isCondition) {
return instructionsToRemove.count(&instruction) != 0;
}
std::set<gd::BaseEvent *> eventsToRemove;
std::set<gd::Instruction *> instructionsToRemove;
};
} // namespace gd
#endif // EventsRemover_H