Class: R3EXS::Actor
Overview
角色的数据类
Instance Attribute Summary collapse
Attributes inherited from BaseItem
#description, #index, #name, #note
Instance Method Summary collapse
-
#empty? ⇒ Boolean
判断是否为空.
-
#ex_strings ⇒ Array<String>
提取所有的字符串.
-
#in_strings(hash) ⇒ void
将所有的字符串替换为指定的字符串.
-
#initialize(actor, index) ⇒ R3EXS::Actor
constructor
用 RPG::Actor 初始化.
-
#inject_to(actor) ⇒ void
注入到 RPG::Actor 对象.
Constructor Details
#initialize(actor, index) ⇒ R3EXS::Actor
用 RPG::Actor 初始化
1096 1097 1098 1099 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1096 def initialize(actor, index) super(actor, index) @nickname = actor.nickname end |
Instance Attribute Details
#nickname ⇒ String
称号
1088 1089 1090 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1088 def nickname @nickname end |
Instance Method Details
#empty? ⇒ Boolean
判断是否为空
1133 1134 1135 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1133 def empty? super && @nickname.blank? end |
#ex_strings ⇒ Array<String>
提取所有的字符串
1114 1115 1116 1117 1118 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1114 def ex_strings strings = super strings << @nickname strings end |
#in_strings(hash) ⇒ void
This method returns an undefined value.
将所有的字符串替换为指定的字符串
1125 1126 1127 1128 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1125 def in_strings(hash) super(hash) @nickname = hash.fetch(@nickname, @nickname) end |
#inject_to(actor) ⇒ void
This method returns an undefined value.
注入到 RPG::Actor 对象
1106 1107 1108 1109 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1106 def inject_to(actor) super(actor) actor.nickname = @nickname end |