Class: R3EXS::Class::Learning

Inherits:
Object
  • Object
show all
Defined in:
lib/R3EXS/RGSS3_R3EXS.rb

Overview

学习技能类

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(learning, index) ⇒ R3EXS::Class::Learning

用 RPG::Class::Learning 初始化

Parameters:

  • learning (RPG::Class::Learning)

    待处理的 RPG::Class::Learning 对象

  • index (Integer)

    在原始数组中的索引



292
293
294
295
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 292

def initialize(learning, index)
    @index = index
    @note  = learning.note
end

Instance Attribute Details

#indexInteger (readonly)

在原始数组中的索引

Returns:

  • (Integer)


330
331
332
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 330

def index
  @index
end

#noteString

学习技能注释

Returns:

  • (String)


335
336
337
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 335

def note
  @note
end

Instance Method Details

#empty?Boolean

判断是否为空

Returns:

  • (Boolean)


323
324
325
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 323

def empty?
    @note.to_s.empty?
end

#ex_stringsArray<String>

提取所有的字符串

Returns:

  • (Array<String>)


308
309
310
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 308

def ex_strings
    [@note]
end

#in_strings(hash) ⇒ void

This method returns an undefined value.

将所有的字符串替换为指定的字符串

Parameters:

  • hash (Hash<String, String>)

    字符串翻译表



316
317
318
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 316

def in_strings(hash)
    @note = hash[@note] || @note
end

#inject_to(learning) ⇒ void

This method returns an undefined value.

注入到 RPG::Class::Learning 对象

Parameters:



301
302
303
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 301

def inject_to(learning)
    learning.note = @note
end