class RPG::Event::Page

Public Class Methods

new(hash) click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 193
def initialize(hash)
  @condition = RPG::Event::Page::Condition.new hash["condition"]
  @graphic = RPG::Event::Page::Graphic.new hash["graphic"]
  @move_type = hash["move_type"]
  @move_speed = hash["move_speed"]
  @move_frequency = hash["move_frequency"]
  @move_route = RPG::MoveRoute.new hash["move_route"]
  @walk_anime = hash["walk_anime"]
  @step_anime = hash["step_anime"]
  @direction_fix = hash["direction_fix"]
  @through = hash["through"]
  @always_on_top = hash["always_on_top"]
  @trigger = hash["trigger"]
  @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 212
def hash
  dump = {
    condition: "",
    graphic: "",
    move_type: @move_type,
    move_speed: @move_speed,
    move_frequency: @move_frequency,
    move_route: "",
    walk_anime: @walk_anime,
    step_anime: @step_anime,
    direction_fix: @direction_fix,
    through: @through,
    always_on_top: @always_on_top,
    trigger: @trigger,
    list: [],
  }
  @list.each_with_index do |value|
    dump[:list] << value.hash
  end
  dump[:condition] = @condition.hash
  dump[:graphic] = @graphic.hash
  dump[:move_route] = @move_route.hash
  dump
end