Skip to content

Instantly share code, notes, and snippets.

@brigand
Created February 15, 2014 22:29
Show Gist options
  • Save brigand/9026083 to your computer and use it in GitHub Desktop.
Save brigand/9026083 to your computer and use it in GitHub Desktop.
// USERS
world.changed.users.forEach(saveUser);
world.changed.users = [];
// TARGETS
world.changed.targets.forEach(function(target){
if (target.remove == true){
deleteTarget(target);
}
else {
saveTarget(target);
}
});
world.changed.targets = [];
// ROOMS
world.changed.rooms.forEach(saveRoom);
world.changed.rooms = []; // Cleanup.
// MAPS
world.changed.maps.forEach(saveMap);
world.changed.maps = []; // Cleanup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment