Class: RGSS::GameObject Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/rgss/game_object.rb

Overview

This class is abstract.

Abstract base class for game objects that represent a native type.

Direct Known Subclasses

Shader, Texture

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject

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

#disposeObject


23
24
25
26
# File 'lib/rgss/game_object.rb', line 23

def dispose
  @id = 0
  nil
end

#valid?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

19
20
21
# File 'lib/rgss/game_object.rb', line 19

def valid?
  raise(NotImplementedError, "#{__method__} must be overriden in derived classes")
end