Yeah, spellink error corrected (thanks).  I want to be able to set the
location for a dragon with something like:

drgn=Dragon.new
drgn.location(3,4)

However, I don't want a "location" method added to Dragon nor its
superclass of Creature.  That is, how is the location for drgn
changed?  The exact syntax isn't so important.

I seem to have lost meaningful output from the inspect method, seems
to be the object id :(



thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $ ruby creatures.rb
#<Dragon:0xb7bf031c>
#<Dragon:0xb7bf0308>
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $ cat creatures.rb
require 'ArrayOfCreatures'
require 'MakeCreature'
require 'Location'

include MakeCreature

NumOfCreatures=2
creatures = ArrayOfCreatures.instance

NumOfCreatures.times do |i|
        creatures[i]=Dragon.new
end

creatures[0].location.x = 3

puts creatures
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $ cat Creature.rb
require 'Math'
require 'Traits'
require 'Room'

class Creature

Creature.extend Math
include Math


attr_accessor :location


def initialize ()
        @location       =       Room.new
        @traits         =       Traits.new
end

def saysHello ()
        print self.class
        puts " says to fuck off"
end


def inspect ()
        print "class\t\t"
        print self.class

        @location.inspect
        @traits.inspect

        print "\n"
end


end
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $ cat Dragon.rb
require 'Creature'

class Dragon < Creature

def initialize ()
        super
end

def inspect ()
        super
end


end
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $ cat Location.rb
class Location

attr_accessor :x, :y

def initialize ()
        @x      =       0
        @y      =       0
end

def inspect ()
        print "\nx\t\t"
        print x
        print "\ny\t\t"
        print y
end

end
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $ cat Room.rb
require 'Location'

class Room < Location

def initialize ()
        super
end

def inspect ()
        super
end


end
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $ cat Traits.rb
class Traits




end
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $ date
Tue Nov 13 02:06:30 PST 2007
thufir@arrakis ~/rubyCode/creatures5 $
thufir@arrakis ~/rubyCode/creatures5 $



thanks,

Thufir