王硕 发表于 2014-4-7 21:43
看看这样行不行,依旧是没有工程不能测试,只能目测。有问题的话请点评我的楼层,这样我才能收到提醒。
mod ...
def armors_id result = [] unless two_swords_style result << @armor1_id end result << @armor2_id result << @armor3_id result << @armor4_id return result.compact! end def suit? TaoZhuang::TZ.each_key do |array| return true if array & armors_id == array end return false end
def armors_id
result = []
unless two_swords_style
result << @armor1_id
end
result << @armor2_id
result << @armor3_id
result << @armor4_id
return result.compact!
end
def suit?
TaoZhuang::TZ.each_key do |array|
return true if array & armors_id == array
end
return false
end
这样其实感觉更好看= = |