Class: Wowr::Classes::EquippedItem

Inherits:
Item
  • Object
show all
Defined in:
lib/wowr/character.rb

Overview

An item equipped to a player

Instance Attribute Summary collapse

Attributes inherited from Item

#icon_base, #id, #name

Instance Method Summary collapse

Methods inherited from Item

#icon

Constructor Details

#initialize(elem, api = nil) ⇒ EquippedItem

Returns a new instance of EquippedItem.



721
722
723
724
725
726
727
728
729
730
731
732
733
# File 'lib/wowr/character.rb', line 721

def initialize(elem, api = nil)
	super(elem, api)
	@durability						= elem[:durability].to_i
	@max_durability				= elem[:maxDurability].to_i
	@gems = []
	@gems[0]							= elem[:gem0Id].to_i == 0 ? nil : elem[:gem0Id].to_i
	@gems[1]							= elem[:gem1Id].to_i == 0 ? nil : elem[:gem1Id].to_i
	@gems[2]							= elem[:gem2Id].to_i == 0 ? nil : elem[:gem2Id].to_i
	@permanent_enchant		= elem[:permanentEnchant].to_i
	@random_properties_id = elem[:randomPropertiesId] == 0 ? nil : elem[:randomPropertiesId].to_i
	@seed									= elem[:seed].to_i # not sure if seed is so big it's overloading
	@slot									= elem[:slot].to_i
end

Instance Attribute Details

#durabilityObject (readonly)

:id, :item_id, :icon,



717
718
719
# File 'lib/wowr/character.rb', line 717

def durability
  @durability
end

#gemsObject (readonly)

:id, :item_id, :icon,



717
718
719
# File 'lib/wowr/character.rb', line 717

def gems
  @gems
end

#max_durabilityObject (readonly)

:id, :item_id, :icon,



717
718
719
# File 'lib/wowr/character.rb', line 717

def max_durability
  @max_durability
end

#permanent_enchantObject (readonly)

:id, :item_id, :icon,



717
718
719
# File 'lib/wowr/character.rb', line 717

def permanent_enchant
  @permanent_enchant
end

#random_properties_idObject (readonly)

:id, :item_id, :icon,



717
718
719
# File 'lib/wowr/character.rb', line 717

def random_properties_id
  @random_properties_id
end

#seedObject (readonly)

:id, :item_id, :icon,



717
718
719
# File 'lib/wowr/character.rb', line 717

def seed
  @seed
end

#slotObject (readonly)

:id, :item_id, :icon,



717
718
719
# File 'lib/wowr/character.rb', line 717

def slot
  @slot
end