mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 16:12:35 +00:00
30 lines
744 B
Ruby
30 lines
744 B
Ruby
class IMICFPS
|
|
TextureCoordinate = Struct.new(:u, :v, :weight)
|
|
Point = Struct.new(:x, :y)
|
|
Color = Struct.new(:red, :green, :blue, :alpha)
|
|
Face = Struct.new(:vertices, :uvs, :normals, :material, :smoothing)
|
|
|
|
module EntityManager # Get included into GameState context
|
|
def add_entity(entity)
|
|
@collision_manager.add(entity)# Add every entity to collision manager
|
|
@entities << entity
|
|
end
|
|
|
|
def find_entity(entity)
|
|
@entities.detect {|entity| entity == entity}
|
|
end
|
|
|
|
def remove_entity(entity)
|
|
ent = @entities.detect {|entity| entity == entity}
|
|
if ent
|
|
@collision_manager.remove(entity)
|
|
@entities.delete(ent)
|
|
end
|
|
end
|
|
|
|
def entities
|
|
@entities
|
|
end
|
|
end
|
|
end
|