Class: RGSS::GameObject Abstract
- Inherits:
-
Object
- Object
- RGSS::GameObject
- Defined in:
- lib/rgss/game_object.rb
Overview
This class is abstract.
Abstract base class for game objects that represent a native type.
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #dispose ⇒ Object
-
#initialize(id) ⇒ GameObject
constructor
A new instance of GameObject.
- #valid? ⇒ Boolean
Constructor Details
#initialize(id) ⇒ GameObject
Returns a new instance of GameObject.
11 12 13 |
# File 'lib/rgss/game_object.rb', line 11 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/rgss/game_object.rb', line 9 def id @id end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/rgss/game_object.rb', line 15 def ==(other) self.class == other.class && @id == other.id end |
#dispose ⇒ Object
23 24 25 26 |
# File 'lib/rgss/game_object.rb', line 23 def dispose @id = 0 nil end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/rgss/game_object.rb', line 19 def valid? raise(NotImplementedError, "#{__method__} must be overriden in derived classes") end |