I have this class and I want to make a dictionary of it
class Building:
# building type
var type : int
# building texture
var iconTexture : Texture
# resource the building produces
var prodResource : int = 0
var prodResourceAmount : int
func _init (type, iconTexture, prodResource, prodResourceAmount):
self.type = type
self.iconTexture = iconTexture
self.prodResource = prodResource
self.prodResourceAmount = prodResourceAmount
func _ready():
var base = Building.new(0, preload("res://Base.png"), 0, 0)
var mine = Building.new(1, preload("res://Mine.png"), 2, 1)
var greenhouse = Building.new(2, preload("res://Greenhouse.png"), 1, 1)
var solarpanel = Building.new(3, preload("res://SolarPanel.png"), 4, 1)
I had copied it from a tutorial and now I want to convert these four building's attribute into a dictionary. please tell how can i do it