See #4628.
Details
- Reviewers
- None
Serialization should be considered especially.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 2245 Build 3705: Vulcan Build (Windows) Jenkins Build 3704: Vulcan Build Jenkins Build 3703: arc lint + arc unit
Event Timeline
Executing section Default... Executing section Source... Executing section JS... binaries/data/mods/public/simulation/components/Trigger_Regicide.js | 34| » » ····playersCivs.every(civ·=>·civ·!=·identity.Civ)) | | [NORMAL] JSHintBear: | | Don't make functions within a loop. binaries/data/mods/public/simulation/components/Trigger_Regicide.js | 67| » » let·spawnPoints·=·cmpRangeManager.GetEntitiesByPlayer(playerID).sort((entity1,·entity2)·=> | | [NORMAL] JSHintBear: | | Don't make functions within a loop. binaries/data/mods/public/simulation/components/Trigger_Regicide.js | 74| » » » let·distanceToShip·=·entity·=> | | [NORMAL] JSHintBear: | | Don't make functions within a loop. binaries/data/mods/public/simulation/components/Trigger_Regicide.js | 76| » » » spawnPoints·=·TriggerHelper.GetLandSpawnPoints().sort((entity1,·entity2)·=> | | [NORMAL] JSHintBear: | | Don't make functions within a loop. Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/171/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jw:8080/job/phabricator/1531/ for more details.
How is that different (or better) than just making this a component? (Since from a quick glance you don't really need anything from cmpTrigger for this.)
Then the trigger component could be deleted, because there's nothing useful in it, is it?
No, that one should be left since it aims to provide a somewhat simplified way to add code.
The question would be whether we want
- the victory condition and map scripts to remain exemplary uses of Trigger scripts (in which case we should use inheritance)
- or don't use inheritance and remove the unused Trigger component
- or don't use inheritance and leave the unused Trigger component for any remaining use-case that should be pointed out
If it's the former and if we want to fix the naming conflict issue, then the new Trigger scripts should inherit and use the the inherited file (not because the code needs it, but to remain an example to modders).
The only simplification I could find is having example trigger scripts and a list of usable events in one place.
Wasn't it also about adding an interface that can be accessed from Atlas? (IIRC I've seen an example or actual GUI on old (wfg?) screenshots Vladislav had shown me somewhere).
Though that might need custom/external code, not that specific Trigger cmp code we currently have.
So if we want to keep any benefit (and maintenance costs) of that Trigger component, then we could still use prototype inheritance.