Class: R3EXS::Actor

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

Overview

角色的数据类

Instance Attribute Summary collapse

Attributes inherited from BaseItem

#description, #index, #name, #note

Instance Method Summary collapse

Constructor Details

#initialize(actor, index) ⇒ R3EXS::Actor

用 RPG::Actor 初始化

Parameters:

  • actor (RPG::Actor)

    待处理的 RPG::Actor 对象

  • index (Integer)

    在原始数组中的索引



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

#nicknameString

称号

Returns:



1088
1089
1090
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1088

def nickname
  @nickname
end

Instance Method Details

#empty?Boolean

判断是否为空

Returns:

  • (Boolean)


1133
1134
1135
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1133

def empty?
  super && @nickname.blank?
end

#ex_stringsArray<String>

提取所有的字符串

Returns:



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.

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

Parameters:



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 对象

Parameters:

  • actor (RPG::Actor)

    待注入的 RPG::Actor 对象



1106
1107
1108
1109
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1106

def inject_to(actor)
  super(actor)
  actor.nickname = @nickname
end