mirror of
https://github.com/EDCD/coriolis-data.git
synced 2025-12-09 07:33:24 +00:00
Tidy-ups for blueprint info
This commit is contained in:
4161
dist/index.js
vendored
4161
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
4455
dist/index.json
vendored
4455
dist/index.json
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -728,8 +728,8 @@
|
||||
},
|
||||
"scb": {
|
||||
"blueprints": {
|
||||
"ShieldCellBank_Rapid": [1, 2, 3, 4],
|
||||
"ShieldCellBank_Specialised": [1, 2, 3, 4]
|
||||
"ShieldCellBank_Rapid": [1, 2, 3],
|
||||
"ShieldCellBank_Specialised": [1, 2, 3]
|
||||
},
|
||||
"modifications": [
|
||||
"boot",
|
||||
|
||||
@@ -169,23 +169,26 @@ describe('JSON Data', function() {
|
||||
|
||||
it('has valid blueprints', function() {
|
||||
var ids = {};
|
||||
var names = {};
|
||||
|
||||
for (var k in Modifications.blueprints) {
|
||||
const blueprint = Modifications.blueprints[k];
|
||||
for (var blueprintname in Modifications.blueprints) {
|
||||
const blueprint = Modifications.blueprints[blueprintname];
|
||||
expect(names[blueprintname]).toBeFalsy('Name already exists: ' + blueprintname);
|
||||
names[blueprintname] = true;
|
||||
expect(ids[blueprint.id]).toBeFalsy('ID already exists: ' + blueprint.id);
|
||||
expect(blueprint.name).toBeDefined('Blueprint has no name, ID:' + blueprint.id);
|
||||
|
||||
for (var x in blueprint.features) {
|
||||
var b = blueprint.features[x];
|
||||
var bfs = {};
|
||||
for (var bf in b) {
|
||||
expect(bfs[bf]).toBeFalsy(`Blueprint feature [${bf}] already exists: ${blueprint.name}`);
|
||||
expect(Modifications.modifications[bf]).toBeDefined(`Blueprint feature [${bf}] uknown: ${blueprint.name}`);
|
||||
bfs[bf] = true;
|
||||
}
|
||||
}
|
||||
|
||||
ids[blueprint.id] = true;
|
||||
expect(blueprint.name).toBeDefined('Blueprint has no name, ID:' + blueprint.id);
|
||||
expect(blueprint.grades).toBeDefined('Blueprint has no grades, ID:' + blueprint.id);
|
||||
|
||||
grades = {}
|
||||
for (var grade in blueprint.grades) {
|
||||
expect(grades[grade]).toBeFalsy('Grade already exists: ' + grade + ' for ' + blueprintname);
|
||||
grades[grade] = true;
|
||||
|
||||
const blueprintgrade = blueprint.grades[grade];
|
||||
expect(blueprintgrade.components).toBeDefined('Blueprint grade ' + grade + ' has no components for ' + blueprintname);
|
||||
expect(blueprintgrade.features).toBeDefined('Blueprint grade ' + grade + ' has no features for ' + blueprintname);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user