From 47eaa9f4d8f02597315f232725f4b300cbbcc7e8 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Date: Sat, 6 Mar 2021 17:09:36 -0500 Subject: [PATCH] Started adding events handling --- lib/aethyr/core/actions/commands/command_action.rb | 4 ++-- lib/aethyr/core/event.rb | 12 +----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/aethyr/core/actions/commands/command_action.rb b/lib/aethyr/core/actions/commands/command_action.rb index 344bcb9..789a7b0 100644 --- a/lib/aethyr/core/actions/commands/command_action.rb +++ b/lib/aethyr/core/actions/commands/command_action.rb @@ -13,10 +13,10 @@ module Aethyr #Looks in player's inventory and room for name. #Then checks at global level for GOID. def find_object(name, event) - if event[:actor].nil? + if self[:actor].nil? return $manager.find(name, nil) || $manager.get_object(name) else - return $manager.find(name, event[:actor]) || $manager.find(name, event[:actor].container) || $manager.get_object(name) + return $manager.find(name, self[:actor]) || $manager.find(name, self[:actor].container) || $manager.get_object(name) end end end diff --git a/lib/aethyr/core/event.rb b/lib/aethyr/core/event.rb index c24ce88..21cfb35 100644 --- a/lib/aethyr/core/event.rb +++ b/lib/aethyr/core/event.rb @@ -61,18 +61,8 @@ class Event < OpenStruct #name must be a symbol which is the same as the module which handles the event. # #An optional hash can be passed in as well to define attributes. - def initialize(type, args = nil) + def initialize(**args) super args - self.type = type - end - - #This is the event type. <i>Depreciated.</i> - def type - @table[:type] - end - - def type= value - @table[:type] = value end #Retrieve an attribute. -- GitLab