Class: MapEntity::EntityBuilder
- Inherits:
-
Object
- Object
- MapEntity::EntityBuilder
- Defined in:
- lib/map/entity.rb
Overview
Entity builder class
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
Instance Method Summary collapse
- #add_nametag(nametag) ⇒ Object
- #add_type(type) ⇒ Object
-
#build_entity(type, nametag) ⇒ Object
Builds the entity of a dungeon.
-
#initialize ⇒ EntityBuilder
constructor
A new instance of EntityBuilder.
Constructor Details
#initialize ⇒ EntityBuilder
Returns a new instance of EntityBuilder.
35 36 37 |
# File 'lib/map/entity.rb', line 35 def initialize() @entity = Entity.new() end |
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
39 40 41 |
# File 'lib/map/entity.rb', line 39 def entity @entity end |
Instance Method Details
#add_nametag(nametag) ⇒ Object
51 52 53 |
# File 'lib/map/entity.rb', line 51 def () @entity. = end |
#add_type(type) ⇒ Object
47 48 49 |
# File 'lib/map/entity.rb', line 47 def add_type(type) @entity.type = type end |
#build_entity(type, nametag) ⇒ Object
Builds the entity of a dungeon
42 43 44 45 |
# File 'lib/map/entity.rb', line 42 def build_entity(type, ) add_type(type) () end |