加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 ORANGI 于 2012-8-28 10:44 编辑
@item_order.each do |goods| case goods[0] when 0; item = $data_items[goods[1]] when 1; item = $data_weapons[goods[1]] when 2; item = $data_armors[goods[1]] end if item @data.push(item) @price[item] = goods[2] == 0 ? item.price : goods[3] end end
@item_order.each do |goods|
case goods[0]
when 0; item = $data_items[goods[1]]
when 1; item = $data_weapons[goods[1]]
when 2; item = $data_armors[goods[1]]
end
if item
@data.push(item)
@price[item] = goods[2] == 0 ? item.price : goods[3]
end
end
根据我的理解是 当 goods 数组的第一个元素为三个值中的某一个时 item 被赋值
但是这样有什么意义? |