Class: Wowr::Classes::EquippedItem
Overview
An item equipped to a player
Instance Attribute Summary collapse
-
#durability ⇒ Object
readonly
:id, :item_id, :icon,.
-
#gems ⇒ Object
readonly
:id, :item_id, :icon,.
-
#max_durability ⇒ Object
readonly
:id, :item_id, :icon,.
-
#permanent_enchant ⇒ Object
readonly
:id, :item_id, :icon,.
-
#random_properties_id ⇒ Object
readonly
:id, :item_id, :icon,.
-
#seed ⇒ Object
readonly
:id, :item_id, :icon,.
-
#slot ⇒ Object
readonly
:id, :item_id, :icon,.
Attributes inherited from Item
Instance Method Summary collapse
-
#initialize(elem, api = nil) ⇒ EquippedItem
constructor
A new instance of EquippedItem.
Methods inherited from Item
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
#durability ⇒ Object (readonly)
:id, :item_id, :icon,
717 718 719 |
# File 'lib/wowr/character.rb', line 717 def durability @durability end |
#gems ⇒ Object (readonly)
:id, :item_id, :icon,
717 718 719 |
# File 'lib/wowr/character.rb', line 717 def gems @gems end |
#max_durability ⇒ Object (readonly)
:id, :item_id, :icon,
717 718 719 |
# File 'lib/wowr/character.rb', line 717 def max_durability @max_durability end |
#permanent_enchant ⇒ Object (readonly)
:id, :item_id, :icon,
717 718 719 |
# File 'lib/wowr/character.rb', line 717 def permanent_enchant @permanent_enchant end |
#random_properties_id ⇒ Object (readonly)
:id, :item_id, :icon,
717 718 719 |
# File 'lib/wowr/character.rb', line 717 def random_properties_id @random_properties_id end |
#seed ⇒ Object (readonly)
:id, :item_id, :icon,
717 718 719 |
# File 'lib/wowr/character.rb', line 717 def seed @seed end |
#slot ⇒ Object (readonly)
:id, :item_id, :icon,
717 718 719 |
# File 'lib/wowr/character.rb', line 717 def slot @slot end |