init commit
This commit is contained in:
15
js/core/DataModel.js
Normal file
15
js/core/DataModel.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import {Instance} from "../instances/Instance.js";
|
||||
|
||||
export class DataModel extends Instance {
|
||||
constructor() {
|
||||
super("DataModel");
|
||||
this.InstanceId = "DataModelRoot"; // Fixed ID for root
|
||||
}
|
||||
GetService(name) {
|
||||
// Loop through children by class name
|
||||
return this.Children.find(c => c.ClassName === name) || null;
|
||||
}
|
||||
GetDataModel() {return this;} // Override to return self
|
||||
} // Just a container for the whole instance tree
|
||||
// cuz this is an Entity Component System, we need a root entity
|
||||
// Assume all children of DataModel are services or top-level game objects
|
||||
Reference in New Issue
Block a user