mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Ran rubocop autocorrect
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class IMICFPS
|
||||
class Subscription
|
||||
attr_reader :entity, :event, :args, :block
|
||||
|
||||
def initialize(entity)
|
||||
@entity = entity
|
||||
|
||||
@@ -13,28 +15,28 @@ class IMICFPS
|
||||
def method_missing(event, *args, &block)
|
||||
return unless Subscription.subscribable_events.include?(event)
|
||||
|
||||
@event, @args, @block = event, args, block
|
||||
@event = event
|
||||
@args = args
|
||||
@block = block
|
||||
Publisher.subscribe(self)
|
||||
end
|
||||
|
||||
def trigger(event, *args)
|
||||
if @block
|
||||
@block.call(event, *args)
|
||||
end
|
||||
@block&.call(event, *args)
|
||||
end
|
||||
|
||||
def self.subscribable_events
|
||||
[
|
||||
:tick,
|
||||
:create, :move, :destroy,
|
||||
:entity_moved,
|
||||
:button_down, :button_up,
|
||||
:mouse_move,
|
||||
:interact,
|
||||
:player_join, :player_leave, :player_die,
|
||||
:pickup_item, :use_item, :drop_item,
|
||||
:enter_vehicle, :exit_vehicle,
|
||||
%i[
|
||||
tick
|
||||
create move destroy
|
||||
entity_moved
|
||||
button_down button_up
|
||||
mouse_move
|
||||
interact
|
||||
player_join player_leave player_die
|
||||
pickup_item use_item drop_item
|
||||
enter_vehicle exit_vehicle
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user