Class: R3EXS::Troop::Page
- Inherits:
-
Object
- Object
- R3EXS::Troop::Page
- Defined in:
- lib/R3EXS/RGSS3_R3EXS.rb
Overview
战斗事件(页)的数据类
Instance Attribute Summary collapse
-
#index ⇒ Integer
在原始数组中的索引.
-
#list ⇒ Array<R3EXS::EventCommand>
执行内容.
Instance Method Summary collapse
-
#empty? ⇒ Boolean
判断是否为空.
-
#ex_strings ⇒ Array<String>
提取所有的字符串.
-
#in_strings(hash) ⇒ void
将所有的字符串替换为指定的字符串.
-
#initialize(page, index) ⇒ R3EXS::Troop::Page
constructor
用 RPG::Troop::Page 初始化.
-
#inject_to(page) ⇒ void
注入到 RPG::Troop::Page 对象.
Constructor Details
#initialize(page, index) ⇒ R3EXS::Troop::Page
用 RPG::Troop::Page 初始化
1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1514 def initialize(page, index) @index = index @list = [] page.list.each_with_index do |eventcommand, eventcommand_index| next if eventcommand.nil? eventcommand_r3exs = R3EXS::EventCommand.new(eventcommand, eventcommand_index) @list << eventcommand_r3exs unless eventcommand_r3exs.empty? end end |
Instance Attribute Details
#index ⇒ Integer
在原始数组中的索引
1501 1502 1503 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1501 def index @index end |
#list ⇒ Array<R3EXS::EventCommand>
执行内容
1506 1507 1508 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1506 def list @list end |
Instance Method Details
#empty? ⇒ Boolean
判断是否为空
1555 1556 1557 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1555 def empty? @list.empty? end |
#ex_strings ⇒ Array<String>
提取所有的字符串
1537 1538 1539 1540 1541 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1537 def ex_strings strings = [] @list.each { |eventcommand| strings.concat(eventcommand.ex_strings) } strings end |
#in_strings(hash) ⇒ void
This method returns an undefined value.
将所有的字符串替换为指定的字符串
1548 1549 1550 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1548 def in_strings(hash) @list.each { |eventcommand| eventcommand.in_strings(hash) } end |
#inject_to(page) ⇒ void
This method returns an undefined value.
注入到 RPG::Troop::Page 对象
1530 1531 1532 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1530 def inject_to(page) @list.each { |eventcommand| eventcommand.inject_to(page.list[eventcommand.index]) } end |