class Olib::Gameobj_Extender

Attributes

type[RW]

Public Class Methods

new(item) click to toggle source
# File lib/Olib/core/extender.rb, line 6
def initialize(item)
  self.__extend__(item)
  @type = item.type
end

Public Instance Methods

__extend__(item) click to toggle source

This copies GameObj data to attributes so we can employ it for scripting

# File lib/Olib/core/extender.rb, line 12
def __extend__(item)
  item.instance_variables.each { |var|
    s = var.to_s.sub('@', '')
    (class << self; self end).class_eval do; attr_accessor "#{s}"; end
    instance_variable_set "#{var}", item.send(s)
  }
end
at() click to toggle source
# File lib/Olib/core/extender.rb, line 25
def at
  fput "look at ##{@id}"
end
echo() click to toggle source
# File lib/Olib/core/extender.rb, line 20
def echo
  respond self
  self
end