module Consumes
def eat(food)
bug = "Method not implemented exception!"
raise bug
log.bug bug
end
end
# then in the class
class Character
include Consumes
def eat(food)
hp += food.hp_value
end
end
module Moveable
def on_move()
@in_room.characters << self
# still needs to take care of the player list
# * crummy example, but you get the point
end
end
define superclassfunction()
do some stuff
call self.subclassfunction()
end
// do not define subclass function
module Consumes
def eat; end
end
class Character; end
c = Character.new.eat # => error - as mentioned earlier, Ruby knows that eat is undefined
class Character
include Consumes
end
c = Character.new.eat # => not an error, which is the PROBLEM because it doesnt force
# the author to impelement the method
of creating a generic Mob class, it creates a new class for the Mob itself. My vision for Ruby
might look like:
What's nice about this to me, is it takes advantage of scripting much like LPC.
Any ideas? What are your thoughts about using this for rooms too?