mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-02-16 17:30:27 +00:00
ecs: fixed eidofs
This commit is contained in:
parent
2d5eec8ba3
commit
1f64a623aa
@ -53,6 +53,8 @@ source/if query?
|
|||||||
|
|
||||||
crazy idea -- full expansion, then relooper
|
crazy idea -- full expansion, then relooper
|
||||||
|
|
||||||
|
how to avoid cycle crossing for critical code and data?
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -555,7 +557,7 @@ class ActionEval {
|
|||||||
state.x = int;
|
state.x = int;
|
||||||
this.entities = int.entities; // TODO?
|
this.entities = int.entities; // TODO?
|
||||||
}
|
}
|
||||||
} else {
|
} else if (this.action.select == 'with') {
|
||||||
if (this.qr.entities.length != 1)
|
if (this.qr.entities.length != 1)
|
||||||
throw new ECSError(`query outside of loop must match exactly one entity`, this.action);
|
throw new ECSError(`query outside of loop must match exactly one entity`, this.action);
|
||||||
}
|
}
|
||||||
@ -752,13 +754,12 @@ class ActionEval {
|
|||||||
if (!range) throw new ECSError(`couldn't find field for ${component.name}:${fieldName}, maybe no entities?`); // TODO
|
if (!range) throw new ECSError(`couldn't find field for ${component.name}:${fieldName}, maybe no entities?`); // TODO
|
||||||
// TODO: dialect
|
// TODO: dialect
|
||||||
let ident = this.dialect.fieldsymbol(component, field, bitofs);
|
let ident = this.dialect.fieldsymbol(component, field, bitofs);
|
||||||
|
let eidofs = qr.entities.length && qr.entities[0].id - range.elo; // TODO: negative?
|
||||||
if (baseLookup) {
|
if (baseLookup) {
|
||||||
return this.dialect.absolute(ident);
|
return this.dialect.absolute(ident);
|
||||||
} else if (entities.length == 1) {
|
} else if (entities.length == 1) {
|
||||||
return this.dialect.absolute(ident, entities[0].id - qr.entities[0].id);
|
return this.dialect.absolute(ident, eidofs);
|
||||||
} else {
|
} else {
|
||||||
let eidofs = range.elo - qr.entities[0].id; // TODO
|
|
||||||
// TODO: eidofs?
|
|
||||||
let ir;
|
let ir;
|
||||||
if (this.scope.state.x?.intersection(qr)) {
|
if (this.scope.state.x?.intersection(qr)) {
|
||||||
ir = this.scope.state.x;
|
ir = this.scope.state.x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user