Files
0ad/binaries/data/mods/public/globalscripts/tests/test_AttackEffects.js
T
Freagarach 7f7a3edfae Get attack effects from JSON.
Reads attack effects from JSON files to allow easier introduction (one
still needs to modify other components).

Differential revision: D2661
Comments by: @Angen, @bb, @Stan, @wraitii
This was SVN commit r24500.
2021-01-02 07:09:08 +00:00

32 lines
521 B
JavaScript

let effects = {
"eff_A": {
"code": "a",
"name": "A",
"order": "2",
"IID": "IID_A",
"method": "doA"
},
"eff_B": {
"code": "b",
"name": "B",
"order": "1",
"IID": "IID_B",
"method": "doB"
}
};
Engine.ListDirectoryFiles = () => Object.keys(effects);
Engine.ReadJSONFile = (file) => effects[file];
let attackEffects = new AttackEffects();
TS_ASSERT_UNEVAL_EQUALS(attackEffects.Receivers(), [{
"type": "b",
"IID": "IID_B",
"method": "doB"
}, {
"type": "a",
"IID": "IID_A",
"method": "doA"
}]);