46 old_world->removeObserver(observer_handle_);
56 world->addObserver([
this](
const World::ObjectConstPtr&
object,
World::Action action) { notify(
object, action); });
64 changes_ =
other.changes_;
67 observer_handle_ =
world->addObserver(
68 [
this](
const World::ObjectConstPtr&
object,
World::Action action) { notify(
object, action); });
78 old_world->removeObserver(observer_handle_);
89 old_world->removeObserver(observer_handle_);
93 world->addObserver([
this](
const World::ObjectConstPtr&
object,
World::Action action) { notify(
object, action); });
102 old_world->removeObserver(observer_handle_);
108 world->addObserver([
this](
const World::ObjectConstPtr&
object,
World::Action action) { notify(
object, action); });
117void WorldDiff::notify(
const World::ObjectConstPtr& obj,
World::Action action)
Maintain a diff list of changes that have happened to a World.
void set(const std::string &id, World::Action val)
void setWorld(const WorldPtr &world)
Set which world to record. Records all objects in old world (if any) as DESTROYED and all objects in ...
void clearChanges()
Clear the internally maintained vector of changes.
void reset()
Turn off recording and erase all previously recorded changes.
Represents an action that occurred on an object in the world. Several bits may be set indicating seve...