加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
在 RPG::Map的定义中,使用“Table”创建了data
但是文档里没给出Table这个类的定义,网上也搜不到
求助大佬,这个类该如何使用,或者在哪里可以找到它的定义
原代码如下class RPG::Map def initialize(width, height) @display_name = '' @tileset_id = 1 @width = width @height = height @scroll_type = 0 @specify_battleback = false @battleback_floor_name = '' @battleback_wall_name = '' @autoplay_bgm = false @bgm = RPG::BGM.new @autoplay_bgs = false @bgs = RPG::BGS.new('', 80) @disable_dashing = false @encounter_list = [] @encounter_step = 30 @parallax_name = '' @parallax_loop_x = false @parallax_loop_y = false @parallax_sx = 0 @parallax_sy = 0 @parallax_show = false @note = '' @data = Table.new(width, height, 4) @events = {} end attr_accessor :display_name attr_accessor :tileset_id attr_accessor :width attr_accessor :height attr_accessor :scroll_type attr_accessor :specify_battleback attr_accessor :battleback1_name attr_accessor :battleback2_name attr_accessor :autoplay_bgm attr_accessor :bgm attr_accessor :autoplay_bgs attr_accessor :bgs attr_accessor :disable_dashing attr_accessor :encounter_list attr_accessor :encounter_step attr_accessor :parallax_name attr_accessor :parallax_loop_x attr_accessor :parallax_loop_y attr_accessor :parallax_sx attr_accessor :parallax_sy attr_accessor :parallax_show attr_accessor :note attr_accessor :data attr_accessor :events end
class RPG::Map
def initialize(width, height)
@display_name = ''
@tileset_id = 1
@width = width
@height = height
@scroll_type = 0
@specify_battleback = false
@battleback_floor_name = ''
@battleback_wall_name = ''
@autoplay_bgm = false
@bgm = RPG::BGM.new
@autoplay_bgs = false
@bgs = RPG::BGS.new('', 80)
@disable_dashing = false
@encounter_list = []
@encounter_step = 30
@parallax_name = ''
@parallax_loop_x = false
@parallax_loop_y = false
@parallax_sx = 0
@parallax_sy = 0
@parallax_show = false
@note = ''
@data = Table.new(width, height, 4)
@events = {}
end
attr_accessor :display_name
attr_accessor :tileset_id
attr_accessor :width
attr_accessor :height
attr_accessor :scroll_type
attr_accessor :specify_battleback
attr_accessor :battleback1_name
attr_accessor :battleback2_name
attr_accessor :autoplay_bgm
attr_accessor :bgm
attr_accessor :autoplay_bgs
attr_accessor :bgs
attr_accessor :disable_dashing
attr_accessor :encounter_list
attr_accessor :encounter_step
attr_accessor :parallax_name
attr_accessor :parallax_loop_x
attr_accessor :parallax_loop_y
attr_accessor :parallax_sx
attr_accessor :parallax_sy
attr_accessor :parallax_show
attr_accessor :note
attr_accessor :data
attr_accessor :events
end
|