Class: RPG::Event

Inherits:
Object
  • Object
show all
Extended by:
RgssDb::JsonableConstructor
Includes:
RgssDb::Jsonable
Defined in:
lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb,
lib/rgss_db/model/rpg_maker_data/xp/rpg/event.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event.rb,
lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page.rb,
lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page.rb,
lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page_graphic.rb,
lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page_graphic.rb,
lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page_condition.rb,
lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page_condition.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page_graphic.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page_condition.rb

Overview

The data class for map events.

Defined Under Namespace

Classes: Page

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RgssDb::JsonableConstructor

json_create, json_new

Methods included from RgssDb::Jsonable

#as_json, #to_json

Constructor Details

#initialize(x, y) ⇒ Event

Returns a new instance of Event.



11
12
13
14
15
16
17
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb', line 11

def initialize(x, y)
  @id = 0
  @name = ""
  @x = x
  @y = y
  @pages = [RPG::Event::Page.new]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



34
35
36
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb', line 34

def id
  @id
end

#nameObject

Returns the value of attribute name.



34
35
36
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb', line 34

def name
  @name
end

#pagesObject

Returns the value of attribute pages.



34
35
36
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb', line 34

def pages
  @pages
end

#xObject

Returns the value of attribute x.



34
35
36
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb', line 34

def x
  @x
end

#yObject

Returns the value of attribute y.



34
35
36
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb', line 34

def y
  @y
end

Class Method Details

.json_new(*args) ⇒ Object

JSON constructor

Parameters:

  • args (Array)

Returns:

  • Class instance



30
31
32
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb', line 30

def self.json_new(*args)
  new(-1, -1)
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb', line 19

def to_s
  @name.to_s
end