Ticket #41636

In use function for extra flags

Eröffnet am: 2021-02-23 17:09 Letztes Update: 2021-02-26 00:23

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Accepted
Datei:
1

Details

Add the new function extra_flag_is_in_use() It checks if the specified flag is used in the current ruleset.

Ticket-Verlauf (3/8 Historien)

2021-02-23 17:09 Aktualisiert von: kvilhaugsvik
  • New Ticket "In use function for extra flags" created
2021-02-23 17:11 Aktualisiert von: kvilhaugsvik
  • Lösung Update from Keine to Accepted
2021-02-23 18:38 Aktualisiert von: cazfi
Kommentar

Do you need this outside ruledit? If I were to search for such a function from freeciv codebase, I would assume it to be in tools/ruledit/validity.ch, and named is_extra_flag_needed()

2021-02-23 19:33 Aktualisiert von: kvilhaugsvik
Kommentar

Reply To cazfi

Do you need this outside ruledit?

I need it for universal_never_there() that lives in common. universal_never_there() could - if I remember correctly - move to the server if we don't care about special handling for rulesets that requires a universal that isn't there in autohelp and other client code that reasons about requirements. The only existing handling of that kind I recall right now is how action_is_in_use() is used by autohelp to check if all units are immune to an action because the action isn't enabled and therefore shouldn't be documented. It can move to ruledit if we - going by memory again here - don't want the option to clean the updated ruleset as a part of ruleset upgrade. This isn't done at the moment.

In case it living in common is OK for you: Do you want something in tools/ruledit/validity for ruledit?

2021-02-23 19:44 Aktualisiert von: cazfi
Kommentar

If you are implementing functionality like that to server, you may need functions already existing in validity.c -> maybe we should move it to common or server? If I recall correctly, it has no dependencies to other ruledit, or even tools, code. OTOH I'm not sure I'm a fan of ruleset update purging my WIP/temporarily disabled rules only because they have not been "attached" to anything in their current version.

2021-02-23 20:44 Aktualisiert von: kvilhaugsvik
Kommentar

Reply To cazfi

OTOH I'm not sure I'm a fan of ruleset update purging my WIP/temporarily disabled rules only because they have not been "attached" to anything in their current version.

In that case I won't add it to ruleset update (rscompat) but keep it as an option for ruleup. Would you like ruleup to be dirty by default rather than clean by default?

I could also move the purging of non enabled actions from lists from rulesave to the ruleset purging code or make it configurable in some other way.

2021-02-26 00:23 Aktualisiert von: kvilhaugsvik
  • Status Update from Offen to Geschlossen
Kommentar

Reply To kvilhaugsvik

I could also move the purging of non enabled actions from lists from rulesave to the ruleset purging code or make it configurable in some other way.

#41651

Reply To cazfi

If you are implementing functionality like that to server, you may need functions already existing in validity.c -> maybe we should move it to common or server? If I recall correctly, it has no dependencies to other ruledit, or even tools, code.

#41652

Bearbeiten

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Anmelden