refactor(GameEngine): Add override keyword to virtual function overrides#2392
Open
bobtista wants to merge 6 commits intoTheSuperHackers:mainfrom
Open
refactor(GameEngine): Add override keyword to virtual function overrides#2392bobtista wants to merge 6 commits intoTheSuperHackers:mainfrom
bobtista wants to merge 6 commits intoTheSuperHackers:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/GameLogic/ScriptActions.h | Non-virtual methods executeAction, closeWindows, and doEnableOrDisableObjectDifficultyBonuses are correctly promoted to virtual override, fixing previously silent polymorphism dispatch issues when called through a ScriptActionsInterface*. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/ScriptActions.h | Mirror of Generals/ScriptActions.h - same virtual override promotion for executeAction, closeWindows, doEnableOrDisableObjectDifficultyBonuses, and the destructor chain. |
| Generals/Code/GameEngine/Include/GameLogic/ScriptConditions.h | evaluateCondition, evaluateTeamIsContained, and evaluateSkirmishCommandButtonIsReady promoted to virtual override — all three are declared as pure-virtual in ScriptConditionsInterface, so the override keyword is correct. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/ScriptConditions.h | Mirror of Generals/ScriptConditions.h — same virtual override promotions for evaluateCondition, evaluateTeamIsContained, and evaluateSkirmishCommandButtonIsReady. |
| Core/GameEngine/Include/Common/GameAudio.h | AudioManager and AudioManagerDummy virtual overrides correctly annotated; SubsystemInterface has a virtual destructor so all override annotations are valid. |
| Core/GameEngine/Include/GameClient/GameWindowTransitions.h | All Transition subclasses (TextOnFrame, ReverseSound, FullFade, ControlBarArrow, ScreenFade, CountUp, TextType) gain override annotations on init/update/reverse/draw/skip/destructor; the enum{} blocks immediately following are untouched as expected. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/AIGuardRetaliate.h | GeneralsMD-only file; all State subclass overrides (onEnter/update/onExit, crc/xfer/loadPostProcess, shouldExit) correctly annotated with override. |
| GeneralsMD/Code/GameEngine/Include/Common/AcademyStats.h | GeneralsMD-only class; Snapshot virtual methods crc/xfer/loadPostProcess correctly annotated with override. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class SubsystemInterface {
+virtual ~SubsystemInterface()
+virtual init() = 0
+virtual reset() = 0
+virtual update() = 0
}
class ScriptActionsInterface {
+virtual ~ScriptActionsInterface() override
+virtual init() = 0
+virtual reset() = 0
+virtual update() = 0
+virtual executeAction() = 0
+virtual closeWindows() = 0
+virtual doEnableOrDisableObjectDifficultyBonuses() = 0
}
class ScriptActions {
+virtual ~ScriptActions() override
+virtual init() override
+virtual reset() override
+virtual update() override
+virtual executeAction() override
+virtual closeWindows() override
+virtual doEnableOrDisableObjectDifficultyBonuses() override
}
class ScriptConditionsInterface {
+virtual ~ScriptConditionsInterface() override
+virtual init() = 0
+virtual reset() = 0
+virtual update() = 0
+virtual evaluateCondition() = 0
+virtual evaluateTeamIsContained() = 0
+virtual evaluateSkirmishCommandButtonIsReady() = 0
}
class ScriptConditions {
+virtual ~ScriptConditions() override
+virtual init() override
+virtual reset() override
+virtual update() override
+virtual evaluateCondition() override
+virtual evaluateTeamIsContained() override
+virtual evaluateSkirmishCommandButtonIsReady() override
}
SubsystemInterface <|-- ScriptActionsInterface
ScriptActionsInterface <|-- ScriptActions
SubsystemInterface <|-- ScriptConditionsInterface
ScriptConditionsInterface <|-- ScriptConditions
Last reviewed commit: f2574b2
3b4cf3d to
d8471a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
overridekeyword to virtual function overrides in GameEngine (excluding GameLogic/Module)Context
Part 4/6 of splitting #2101. Depends on #2389 merging first.
Notes
overridekeyword additionsvirtualkeyword from enum entries in Scripts.hvirtualkeyword