Skip to content

ComponentUpdateSystem

Adam Martin edited this page May 12, 2015 · 1 revision

Overview

This system is used to queue (not the data structure) up component changes (updates or removals) during the next update cycle. The update cycle happens when it is safe to update the central component storage without the need to provide any type of lock.

Interface

  • ComponentUpdateSystem<TYPE>::Initialize() - this method must be called for each type of component. This setups the update function that gets called from ComponentUpdateSystemList each update cycle. This must only be called once per component type to prevent useless update calls.
  • ComponentUpdateSystem<TYPE>::UpdateTo(frame_id) - applies all update_lists up to and including frame_id from future_update_lists.
  • ComponentUpdateSystem<TYPE>::SubmitUpdate(entity_id, value, frame_id = 0) - submits an update to value to occur for the specified component type belonging to entity_id on frame_id. If frame_id = 0 then the update will be placed in the newest frame_id.
  • ComponentUpdateSystem<TYPE>::SubmitRemoval(entity_id, frame_id = 0) - submits an removal to occur for the specified component type belonging to entity_id on frame_id. If frame_id = 0 then the update will be placed in the newest frame_id.