Module: RuneRb::Game::Entity::Helpers::Equipment

Included in:
Context
Defined in:
app/game/entity/helpers/equipment.rb

Overview

Since:

  • 0.9.3

Instance Method Summary collapse

Instance Method Details

#[](slot) ⇒ Object

Shorthand slot retrieval

Parameters:

  • slot (Integer)

    the slot to retrieve

Since:

  • 0.9.3


14
15
16
# File 'app/game/entity/helpers/equipment.rb', line 14

def [](slot)
  @equipment[slot]
end

#[]=(slot, value) ⇒ Object Also known as: equip

Shorthand slot assignment

Parameters:

Since:

  • 0.9.3


6
7
8
# File 'app/game/entity/helpers/equipment.rb', line 6

def []=(slot, value)
  @equipment[slot] = value
end

#unequip(slot) ⇒ Object

Un-equips an slot.

Parameters:

  • slot (Integer)

    un-equips a slot.

Since:

  • 0.9.3


20
21
22
# File 'app/game/entity/helpers/equipment.rb', line 20

def unequip(slot)
  @equipment[slot] = -1
end