Class: MapEntity::EntityXPathBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/map/entity.rb

Overview

Entity builder class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEntityXPathBuilder

Returns a new instance of EntityXPathBuilder.



37
38
39
# File 'lib/map/entity.rb', line 37

def initialize()
  @entity = Entity.new()
end

Instance Attribute Details

#entityObject (readonly)

Returns the value of attribute entity.



41
42
43
# File 'lib/map/entity.rb', line 41

def entity
  @entity
end

Instance Method Details

#add_nametag(nametag) ⇒ Object



53
54
55
# File 'lib/map/entity.rb', line 53

def add_nametag(nametag)
  @entity.nametag = nametag
end

#add_type(type) ⇒ Object



49
50
51
# File 'lib/map/entity.rb', line 49

def add_type(type)
  @entity.type = type
end

#build_XML_entity(type, nametag) ⇒ Object

Builds the entity of a dungeon



44
45
46
47
# File 'lib/map/entity.rb', line 44

def build_XML_entity(type, nametag)
  add_type(type)
  add_nametag(nametag)
end