Proposal: Simpler '<canal>' node
-
Proposal, introduce a
<canal>
tag to replace:<attachment javaClass="games.strategy.triplea.attachments.CanalAttachment"
Example
<map> <canals> <canal name= seaZone1="" seaZone2=""> <landTerritory name="Central America" /> <landTerritory name="Colombia" /> </canal> </canals> </map>
Example (existing, to be replaced)
<attachment name="canalAttachmentCentral America - Colombia" attachTo="25 Sea Zone" javaClass="games.strategy.triplea.attachments.CanalAttachment" type="territory"> <option name="canalName" value="the Central America - Colombia channel"/> <option name="landTerritories" value="Central America:Colombia"/> </attachment> <attachment name="canalAttachmentCentral America - Colombia" attachTo="100 Sea Zone" javaClass="games.strategy.triplea.attachments.CanalAttachment" type="territory"> <option name="canalName" value="the Central America - Colombia channel"/> <option name="landTerritories" value="Central America:Colombia"/> </attachment>
Backward Compatibility
If a canal is redefined as an attachment then the game would generate an error to indicate the invalid configuration. Otherwise the new 'canals' tag would be optional and the existing attachment tag would continue to work.
-
@LaFayette The code should at least allow for multiple canals between the same two zones and for defining whether you need to be able to move through all of them or at least one of them (AND/OR).
The name "canal" itself is counter intuitive and logically wrong, as a canal is something that allows movement. Instead, the "TripleA" canals have the only function of possibly impeding movement. Meaning that if you delete the "Suez Canal", for example, everything can pass, while you would think that, realistically, without the canal, nothing would be able to pass. So what TripleA calls "canal" is actually not the canal, but the ability of closing it. I suggest finding a better name for it, like "boom" or "lock".
https://en.wikipedia.org/wiki/Boom_(navigational_barrier) -
@Cernel Could you point me to the current XML attachment values that specifies: "defining whether you need to be able to move through all of them or at least one of them (AND/OR)."
-
@LaFayette It's the "Control All Canals Between Territories To Pass" property (I think it should have been an option, so that you could have had both serial and parallel canals for the same game).
This is also related to an actual change to the default TripleA behaviour, made at some point, as the default used to be "AND" and it was changed to "OR" (in my opinion, the "AND" default made more sense: Since the "canal" are blockers, if you have two blockers for the same connection, you should normally be able to go past both).
-
Thanks for pointing me to the property @Cernel ;
I'd like to keep updates limited to the game data assembly layer. That means for now I'll leave the "Control All Canals Between Territories To Pass" property unaltered.