Add data model and structure for swift graph executor, rework create products to bem ore general
This commit is contained in:
23
FastCoster/FastCoster/Model/Graph.swift
Normal file
23
FastCoster/FastCoster/Model/Graph.swift
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Graph.swift
|
||||
// FastCoster
|
||||
//
|
||||
// Created by Michael Pivato on 3/5/2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
// JSON for saving/loading configuration: https://www.avanderlee.com/swift/json-parsing-decoding/
|
||||
struct Node: Codable {
|
||||
var id: Int
|
||||
var info: NodeInfo
|
||||
var dependentNodeIds: [Int]
|
||||
|
||||
func hasDependentNodes() -> Bool {
|
||||
return !dependentNodeIds.isEmpty
|
||||
}
|
||||
}
|
||||
|
||||
struct Graph: Codable {
|
||||
var name: String
|
||||
var nodes: [Node]
|
||||
}
|
||||
Reference in New Issue
Block a user