lib/demiurge/action_item.rb
def queue_action(action_name, *args)
      unless @item.is_a?(::Demiurge::Agent)
        @engine.admin_warning("Trying to queue an action #{action_name.inspect} for an item #{@item.name.inspect} that isn't an agent! Skipping.")
        return
      end
      act = @item.get_action(action_name)
      unless act
        raise Demiurge::Errors::NoSuchActionError.new("Trying to queue an action #{action_name.inspect} for an item #{@item.name.inspect} that doesn't have it!",
                                                      "item" => @item.name, "action" => action_name, execution_context: @item.engine.execution_context)
        return
      end
      @item.queue_action(action_name, args)
    end
# Queue an action for this agent, to be performed during the next
# tick.
#
# @param action_name [String] The action name to queue up
# @param args [Array] Additional arguments to pass to the action block
# @return [void]
# @since 0.0.1
Queue an action for this agent, to be performed during the next
tick.
Queue an action for this agent to be performed during the next tick .
def queue_action(action_name, *args)
      unless @item.is_a?(::Demiurge::Agent)
        @engine.admin_warning("Trying to queue an action #{action_name.inspect} for an item #{@item.name.inspect} that isn't an agent! Skipping.")
        return
      end
      act = @item.get_action(action_name)
      unless act
        raise Demiurge::Errors::NoSuchActionError.new("Trying to queue an action #{action_name.inspect} for an item #{@item.name.inspect} that doesn't have it!",
                                                      "item" => @item.name, "action" => action_name, execution_context: @item.engine.execution_context)
        return
      end
      @item.queue_action(action_name, args)
    end
def queue_action ( action_name , * args ) unless @item . is_a? ( :: Demiurge :: Agent ) @engine . admin_warning ( "Trying to queue an action #{action_name.inspect} for an item #{@item.name.inspect} that isn't an agent! Skipping." ) return end act = @item . get_action ( action_name ) unless act raise Demiurge :: Errors :: NoSuchActionError . new ( "Trying to queue an action #{action_name.inspect} for an item #{@item.name.inspect} that doesn't have it!" , "item" => @item . name , "action" => action_name , execution_context : @item . engine . execution_context ) return end @item . queue_action ( action_name , args ) end
Queue an action for this agent, to be performed during the next
tick.
Queue an action for this agent to be performed during the next tick .
None
void
action_name
The action name to queue up
The action name to queue up
args
Additional arguments to pass to the action block
Additional arguments to pass to the action block
since
None