Class: RuneRb::Database::PlayerAppearance

Inherits:
Object
  • Object
show all
Defined in:
app/database/models/player/appearance.rb

Overview

Information related to the appearance of a player in the virtual game world

Models a row of the `player_appearance` table

Since:

  • 0.9.3

Instance Method Summary collapse

Instance Method Details

#from_mobObject

Resets the `mob_id` column to -1.

During the next ContextSynchronizationMessage this value is observed and the player's actual appearance is sent.

Since:

  • 0.9.3


18
19
20
# File 'app/database/models/player/appearance.rb', line 18

def from_mob
  update(mob_id: -1)
end

#to_head(id) ⇒ Object

Updates the `head_icon` column to the specified value

During the next ContextSynchronizationMessage this value is observed and applied to the ContextStateBlock which will ensure the proper value is sent for the head_icon

Parameters:

  • id (Integer)

    the id of the head_icon to send.

Since:

  • 0.9.3


26
27
28
# File 'app/database/models/player/appearance.rb', line 26

def to_head(id)
  update(head_icon: id)
end

#to_mob(id) ⇒ Object

Updates the `mob_id` column to the specified value.

During the next ContextSynchronizationMessage this value is observed and applied to the ContextStateBlock which will ensure the appropriate mask is applied.

Parameters:

  • id (Integer)

    the id of the mob to appear as.

Since:

  • 0.9.3


11
12
13
# File 'app/database/models/player/appearance.rb', line 11

def to_mob(id)
  update(mob_id: id)
end