Class: RPG::CommonEvent

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

Overview

The data class for common events.

Instance Attribute 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

#initializeCommonEvent

Returns a new instance of CommonEvent.



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

def initialize
  @id = 0
  @name = ""
  @trigger = 0
  @switch_id = 1
  @list = [RPG::EventCommand.new]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



23
24
25
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/common_event.rb', line 23

def id
  @id
end

#listObject

Returns the value of attribute list.



23
24
25
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/common_event.rb', line 23

def list
  @list
end

#nameObject

Returns the value of attribute name.



23
24
25
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/common_event.rb', line 23

def name
  @name
end

#switch_idObject

Returns the value of attribute switch_id.



23
24
25
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/common_event.rb', line 23

def switch_id
  @switch_id
end

#triggerObject

Returns the value of attribute trigger.



23
24
25
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/common_event.rb', line 23

def trigger
  @trigger
end

Instance Method Details

#autorun?Boolean

Returns:

  • (Boolean)


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

def autorun?
  @trigger == 1
end

#parallel?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/common_event.rb', line 23

def parallel?
  @trigger == 2
end

#to_sObject



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

def to_s
  @name.to_s
end