yagvm/Classes/InstallMetadata.gd

31 lines
683 B
GDScript3
Raw Permalink Normal View History

2023-03-05 11:03:08 +00:00
class_name InstallMetadata
2023-05-27 04:36:20 +00:00
var name: String
var icon_path: String
var binary_path: String
var local_overrides: Dictionary
var pids: Array[int] = []
var index: int = 0
func to_d() -> Dictionary:
return {
"name": name,
"icon_path": icon_path,
"binary_path": binary_path,
"local_overrides": local_overrides,
"pids": pids,
"index": index,
}
static func from_d(d: Dictionary) -> InstallMetadata:
var res := InstallMetadata.new()
res.name = d.get("name", "")
res.icon_path = d.get("icon_path", "")
res.binary_path = d.get("binary_path", "")
res.local_overrides = d.get("local_overrides", {})
res.pids = d.get("pids", [])
res.index = d.get("index", 0)
return res