Class: RuneRb::Game::Entity::Commands::Show

Inherits:
RuneRb::Game::Entity::Command show all
Defined in:
app/game/entity/commands/show.rb

Overview

Since:

  • 0.9.3

Instance Method Summary collapse

Methods inherited from RuneRb::Game::Entity::Command

#initialize

Methods included from System::Log

#class_name, #err, #err!, #log, #log!, #symbolize_file

Constructor Details

This class inherits a constructor from RuneRb::Game::Entity::Command

Instance Method Details

#executeObject

Since:

  • 0.9.3


5
6
7
8
9
10
11
12
13
14
15
# File 'app/game/entity/commands/show.rb', line 5

def execute
  unless @command.size >= 1
    @context.session.write_message(:SystemTextMessage, message: 'Invalid arguments!')
    @context.session.write_message(:SystemTextMessage, message: 'Usage:')
    @context.session.write_message(:SystemTextMessage, message: '::show <id>')
    return
  end

  log RuneRb::GLOBAL[:COLOR].green("Writing interface: #{@command[0].to_i}")
  @context.session.write_message(:DisplayInterfaceMessage, id: @command[0].to_i)
end