mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 08:42:21 +00:00
feat(globe): engine-agnostic maps checks and maps.current
The contract suite gains maps checks (opt-in with mapSources: two imagery sources and a photoreal one the engine can show): setPhotorealTiles(null) brings back the last base imagery, the last imagery or photoreal call decides what shows, and a released photoreal source no longer shows or counts. They observe the new maps.current(), the source objects on screen as passed. The fake engine follows the same semantics; qa-globe-contract runs the checks on the app engine with the startup tileset and reapplies the app's map stack afterwards. The contract documents map sources as engine-neutral descriptions whose prebuilt members only the engine kind that built them uses.
This commit is contained in:
1 parent
12c9651a67
commit
ab0acb0e09
6 files changed
+160
-14
No files matched your search
@@ -241,6 +241,7 @@ export function createFakeEngine(options = {}) {
|
||||
};
|
||||
const inputs = new Map(INPUT_TYPES.map((type) => [type, new Set()]));
|
||||
const livePosition = cartesian3.create();
|
||||
let lastBaseImagery = null;
|
||||
const scripts = new Map();
|
||||
let transform = [...matrix4.IDENTITY];
|
||||
let percentageChanged = 0.5;
|
||||
@@ -819,10 +820,13 @@ export function createFakeEngine(options = {}) {
|
||||
};
|
||||
},
|
||||
},
|
||||
// The contract's switch order: a call shows its source when made (the
|
||||
// fake builds nothing), so the call made last decides what shows.
|
||||
maps: {
|
||||
async setBaseImagery(source) {
|
||||
record('maps.setBaseImagery', [source]);
|
||||
fake.maps.imagery = source;
|
||||
lastBaseImagery = source;
|
||||
},
|
||||
async setTerrain(source) {
|
||||
record('maps.setTerrain', [source]);
|
||||
@@ -830,12 +834,23 @@ export function createFakeEngine(options = {}) {
|
||||
},
|
||||
async setPhotorealTiles(source) {
|
||||
record('maps.setPhotorealTiles', [source]);
|
||||
fake.maps.photoreal = source ?? null;
|
||||
if (source == null) {
|
||||
fake.maps.photoreal = null;
|
||||
fake.maps.imagery = lastBaseImagery;
|
||||
return;
|
||||
}
|
||||
fake.maps.photoreal = source;
|
||||
fake.maps.imagery = null;
|
||||
},
|
||||
releasePhotorealTiles(source) {
|
||||
record('maps.releasePhotorealTiles', [source]);
|
||||
if (fake.maps.photoreal === source) fake.maps.photoreal = null;
|
||||
},
|
||||
photorealActive: () => fake.maps.photoreal != null,
|
||||
current: () => ({
|
||||
baseImagery: fake.maps.imagery ?? null,
|
||||
photoreal: fake.maps.photoreal,
|
||||
}),
|
||||
},
|
||||
destroy() {
|
||||
record('destroy', []);
|
||||
|
||||
Reference in new issue
Block a user