Class: Box2D::Handle
- Inherits:
-
Object
show all
- Defined in:
- lib/box2d/handle.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(world, id) ⇒ Handle
Returns a new instance of Handle.
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5
6
7
|
# File 'lib/box2d/handle.rb', line 5
def id
@id
end
|
#world ⇒ Object
Returns the value of attribute world.
5
6
7
|
# File 'lib/box2d/handle.rb', line 5
def world
@world
end
|
Instance Method Details
#destroyed? ⇒ Boolean
18
19
20
|
# File 'lib/box2d/handle.rb', line 18
def destroyed?
!valid?
end
|
#eql?(other) ⇒ Boolean
Also known as:
==
26
27
28
|
# File 'lib/box2d/handle.rb', line 26
def eql?(other)
other.instance_of?(self.class) && other.world.equal?(@world) && other.key == @key
end
|
#hash ⇒ Object
22
23
24
|
# File 'lib/box2d/handle.rb', line 22
def hash
[self.class, @world.object_id, @key].hash
end
|
#valid? ⇒ Boolean
14
15
16
|
# File 'lib/box2d/handle.rb', line 14
def valid?
!@destroyed && @world.valid? && native_valid?
end
|