| 
 
| 赞 | 1 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 6 |  
| 经验 | 71075 |  
| 最后登录 | 2017-9-1 |  
| 在线时间 | 1752 小时 |  
 Lv2.观梦者 
	梦石0 星屑575 在线时间1752 小时注册时间2008-11-7帖子1431 | 
| 
cheak_note = @note
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 cheak_note    这个变量 只能在 当前方法里用吗
 
 @note  未实例的  是不是也只能在 当前方法里用吗
 
 不然下面的 都一样 不是碰在一起了
 
 如果 attr_accessor  就是 实例变量   如果未 attr_accessor  又是什么变量
 
 对于这个 @note   变量 一直搞不懂    @note   这个变量 随时可以生产
 复制代码  def weight
    return 0 unless @note
    cheak_note = @note
    weight = 0
    
    while cheak_note do
      cheak_note.match(/<装备重量\s?(\d+)\s?>/)
      weight += $1.to_i if $1
      cheak_note = $'
    end
    return weight  
  end
  #--------------------------------------------------------------------------
  # ● 最大重量補正の定義(追加定義)
  #--------------------------------------------------------------------------  
  def weight_revise
    return 0 unless @note
    cheak_note = @note
    weight_revise = 0
    
    while cheak_note do
      cheak_note.match(/<最大重量補正\s?(\d+)\s?>/)
      weight_revise += $1.to_i if $1
      cheak_note = $'
    end
    return weight_revise 
  end 
 | 
 |