mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-20 20:26:36 +00:00
7f7a3edfae
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.
32 lines
521 B
JavaScript
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"
|
|
}]);
|