vassalengine / vassal

VASSAL, the open-source boardgame engine
https://vassalengine.org
GNU Lesser General Public License v2.1
413 stars 97 forks source link

Expand scope of "solo/referee" sides #12632

Open riverwanderer opened 1 year ago

riverwanderer commented 1 year ago

I propose a change to isSoloSide() to allow for multiple solo / referee sides within a module, and to allow for auxiliary sides with arbitrary names. An "auxiliary side" is one, for example, that may move pieces on the board within a turn but does not control the turn itself. An example of this is found in Commands & Colors modules (Epic & LGB format scenarios).

Currently, isSoloSide() returns true if the side equals "Solitaire", "Solo:", "Moderator" or "Referee".

I propose that isSoloSide() will return true if the side is "Solo" or begins "Solitaire", "Solo:", "Moderator", "Referee" or ".".

The "." prefix specifies an "auxiliary side".

isSoloSide() is used by PlayerRoster, ChessClockControl and CheckClock. Within PlayerRoster, the change has the desired effect of skipping the now expanded "solo" sides.

The association with Chess Clock logic, implies that any sides starting "." will be impacted in the Chess clock functionality in the same way as the Solo sides (I recall that Solitaire "sides" don't get offered by the clock component). A designer will be unable to use the auxiliary side exclusion prefix if this is not acceptable for their module; this is likely very rare and no worse than the current situation.

In the unlikely event that an existing module contains a side name starting with a period (.), such a side will be excluded from the side switching default and chess clock. These impacts are minimal and easily addressed in an update to the module, if the new behaviour is undesirable.

riverwanderer commented 1 year ago

Example use-cases for the expanded number of solo and other roles to be skipped when hot-seating.

  1. A module may have special solo roles that can be started automatically if a user starts a game in that role. Example: C&C Ancients has 3 solitaire modes. These roles can be skipped by the "starts with" changes (e.g. starts with "Solo:".

  2. Some roles don't apply for particular scenarios. Example: C&C Ancients has 6 auxiliary roles for Epic scenarios. These roles are not required if hot-seating. These roles can be excluded by defining the property VassalSkipSideList (which replaces the idea of using a special character to prefix side names.