class RPG::Event

Public Class Methods

new(hash) click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 167
def initialize(hash)
  @id = hash["id"]
  @name = hash["name"]
  @x = hash["x"]
  @y = hash["y"]
  @pages = []
  hash["pages"].each_with_index do |value|
    @pages << RPG::Event::Page.new(value)
  end
end

Public Instance Methods

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