Skip to content

Commit

Permalink
Expose full list of component storage instances.
Browse files Browse the repository at this point in the history
  • Loading branch information
player-03 committed Oct 13, 2024
1 parent 56da0b3 commit 3cc08da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/echoes/ComponentStorage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ComponentStorage<T> {

public inline function new(componentType:String) {
this.componentType = componentType;
Echoes.componentStorage.push(this);
Echoes._componentStorage.push(this);

//Some platforms get confused by the declaration of `Array<Null<T>>`,
//and treat that as something like `Array<Dynamic>`, and then cast to
Expand Down
6 changes: 4 additions & 2 deletions src/echoes/Echoes.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class Echoes {
#end

@:allow(echoes.ComponentStorage)
private static final componentStorage:Array<DynamicComponentStorage> = [];
private static final _componentStorage:Array<DynamicComponentStorage> = [];
public static var componentStorage:ReadOnlyArray<DynamicComponentStorage>;
private static inline function get_componentStorage():ReadOnlyArray<DynamicComponentStorage> return _componentStorage;

@:allow(echoes.Entity)
private static final _activeEntities:Array<Entity> = [];
Expand Down Expand Up @@ -153,7 +155,7 @@ class Echoes {
activeViews[i].reset();
}

for(storage in componentStorage) {
for(storage in _componentStorage) {
storage.clear();
}
EntityComponents.components.resize(0);
Expand Down

0 comments on commit 3cc08da

Please sign in to comment.