class RPG::CommonEvent

Public Class Methods

new(hash) click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 589
def initialize(hash)
  @id = hash["id"]
  @name = hash["name"]
  @trigger = hash["trigger"]
  @switch_id = hash["switch_id"]
  @list = []
  hash["list"].each_with_index do |value|
    @list << RPG::EventCommand.new(value)
  end
end

Public Instance Methods

hash() click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 600
def hash
  dump = {
    id: @id,
    name: @name.force_encoding("iso-8859-1").encode("utf-8"),
    trigger: @trigger,
    switch_id: @switch_id,
    list: [],
  }
  @list.each_with_index do |value|
    dump[:list] << value.hash
  end
  dump
end