class Twisty::Entity

Super-class of Room and Item. Do not use directly.

NOTE It is possible this class may be removed in future versions.

Attributes

id[R]

(Symbol)The Symbol used to distinguish the Entity from other memebers of the same sub-class

Public Instance Methods

==(other) click to toggle source

(Boolean)

Checks if two different instances of Entity refer to the same datum

other

(Entity) instance of Entity to check for equality against

# File lib/twisty/entity.rb, line 34
def ==(other)
        if other.class == self.class
                return other.id == @id
        elsif other.class == Symbol
                return other == @id
        else
                return false
        end
end
clone(other) click to toggle source

Creates an identical instance of the Entity

other

(Symbol) Index entry of the new instance

# File lib/twisty/entity.rb, line 48
def clone(other)
        raise GameError.new "Can not use Entity directly. Please use subclass instead"
        return nil
end
engine() click to toggle source

(Engine)

Convinience class to access the Engine

# File lib/twisty/entity.rb, line 56
def engine
        return Engine.instance()
end