djeurissen
11.09.2014, 17:49
Tagchen,
ich wollte einfach in Ruby ein Array erstellen das mehrere Items speichert anhand der x Koordinate y Koordinate und der Inventar ID
Blöderweise weiß ich nicht, wie ich nun per Event auf die werte von Item zugreife...
class Item
@@x = 0
@@y = 0
@@id = 0
end
class Game_System
def item_list(invID, x, y)
@item_data ||= Array.new
@item_data[invID] ||= Array.new
@item_data[invID][x] ||= Array.new
@item_data[invID][x][y] ||= Item.new
end
end
class Game_Interpreter
def item_list(invID = 0, x = 0, y = 0)
$game_system.item_list(invID, x, y)
end
end
ich wollte einfach in Ruby ein Array erstellen das mehrere Items speichert anhand der x Koordinate y Koordinate und der Inventar ID
Blöderweise weiß ich nicht, wie ich nun per Event auf die werte von Item zugreife...
class Item
@@x = 0
@@y = 0
@@id = 0
end
class Game_System
def item_list(invID, x, y)
@item_data ||= Array.new
@item_data[invID] ||= Array.new
@item_data[invID][x] ||= Array.new
@item_data[invID][x][y] ||= Item.new
end
end
class Game_Interpreter
def item_list(invID = 0, x = 0, y = 0)
$game_system.item_list(invID, x, y)
end
end