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, with_note) ⇒ R3EXS::Actor
constructor
用 RPG::Actor 初始化.
-
#inject_to(actor) ⇒ void
注入到 RPG::Actor 对象.
Constructor Details
#initialize(actor, index, with_note) ⇒ R3EXS::Actor
用 RPG::Actor 初始化
92 93 94 95 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 92 def initialize(actor, index, with_note) super(actor, index, with_note) @nickname = actor.nickname end |
Instance Attribute Details
#nickname ⇒ String
昵称
134 135 136 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 134 def nickname @nickname end |
Instance Method Details
#empty? ⇒ Boolean
判断是否为空
127 128 129 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 127 def empty? super && @nickname.to_s.empty? end |
#ex_strings ⇒ Array<String>
提取所有的字符串
109 110 111 112 113 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 109 def ex_strings strings = super strings << @nickname strings end |
#in_strings(hash) ⇒ void
This method returns an undefined value.
将所有的字符串替换为指定的字符串
119 120 121 122 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 119 def in_strings(hash) super(hash) @nickname = hash[@nickname] || @nickname end |
#inject_to(actor) ⇒ void
This method returns an undefined value.
注入到 RPG::Actor 对象
101 102 103 104 |
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 101 def inject_to(actor) super(actor) actor.nickname = @nickname end |