mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-13 06:42:35 +00:00
20 lines
422 B
Ruby
20 lines
422 B
Ruby
# frozen_string_literal: true
|
|
|
|
class IMICFPS
|
|
class EventHandler
|
|
class EntityLifeCycle < EventHandler
|
|
def handles
|
|
%i[create move destroy]
|
|
end
|
|
|
|
def handle(subscriber, context, *args)
|
|
return unless subscriber.entity == args.first.first
|
|
|
|
event = EventHandler::Event.new(entity: subscriber.entity, context: context)
|
|
|
|
subscriber.trigger(event)
|
|
end
|
|
end
|
|
end
|
|
end
|