Class: MCP::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/mcp/packets_util.rb

Class Method Summary collapse

Class Method Details

.mappingObject



4
5
6
7
8
9
10
11
12
# File 'lib/mcp/packets_util.rb', line 4

def self.mapping
  MCP.constants.each_with_object({}) do |constant_name, result|
    klass = MCP.const_get(constant_name)
    next unless klass.is_a?(Class)
    next unless klass < Packet
    next unless (klass::Type || :both) != :to_server
    result[klass::Id] = klass
  end
end