summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-03-03 22:25:13 +0000
committerMichael Lutz <michi@icosahedron.de>2019-03-24 16:10:04 +0100
commitaf7d9020a15c1b1a14b3981ac73c70d2e58cc877 (patch)
tree1dcff3e01382ea3a0a4733a4637659dbbfd4bad5 /src/ai
parent31260e66252fb4d0dda6f992520faeeb96929cfe (diff)
downloadopenttd-af7d9020a15c1b1a14b3981ac73c70d2e58cc877.tar.xz
Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual member declaration overrides a base-class member with the same signature. Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked as virtual despite being a template.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_config.hpp12
-rw-r--r--src/ai/ai_gui.cpp2
-rw-r--r--src/ai/ai_instance.hpp12
-rw-r--r--src/ai/ai_scanner.hpp24
4 files changed, 25 insertions, 25 deletions
diff --git a/src/ai/ai_config.hpp b/src/ai/ai_config.hpp
index 30c6f84bb..9f667a612 100644
--- a/src/ai/ai_config.hpp
+++ b/src/ai/ai_config.hpp
@@ -30,9 +30,9 @@ public:
class AIInfo *GetInfo() const;
- /* virtual */ int GetSetting(const char *name) const;
- /* virtual */ void SetSetting(const char *name, int value);
- /* virtual */ void AddRandomDeviation();
+ int GetSetting(const char *name) const override;
+ void SetSetting(const char *name, int value) override;
+ void AddRandomDeviation() override;
/**
* When ever the AI Scanner is reloaded, all infos become invalid. This
@@ -45,9 +45,9 @@ public:
bool ResetInfo(bool force_exact_match);
protected:
- /* virtual */ void PushExtraConfigList();
- /* virtual */ void ClearConfigList();
- /* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match);
+ void PushExtraConfigList() override;
+ void ClearConfigList() override;
+ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match) override;
};
#endif /* AI_CONFIG_HPP */
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index 8e7e12a63..5a4c77246 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -646,7 +646,7 @@ struct ScriptTextfileWindow : public TextfileWindow {
this->LoadTextfile(textfile, (slot == OWNER_DEITY) ? GAME_DIR : AI_DIR);
}
- /* virtual */ void SetStringParameters(int widget) const
+ void SetStringParameters(int widget) const override
{
if (widget == WID_TF_CAPTION) {
SetDParam(0, (slot == OWNER_DEITY) ? STR_CONTENT_TYPE_GAME_SCRIPT : STR_CONTENT_TYPE_AI);
diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp
index 204bf9712..06998558b 100644
--- a/src/ai/ai_instance.hpp
+++ b/src/ai/ai_instance.hpp
@@ -25,14 +25,14 @@ public:
*/
void Initialize(class AIInfo *info);
- /* virtual */ int GetSetting(const char *name);
- /* virtual */ ScriptInfo *FindLibrary(const char *library, int version);
+ int GetSetting(const char *name) override;
+ ScriptInfo *FindLibrary(const char *library, int version) override;
private:
- /* virtual */ void RegisterAPI();
- /* virtual */ void Died();
- /* virtual */ CommandCallback *GetDoCommandCallback();
- /* virtual */ void LoadDummyScript();
+ void RegisterAPI() override;
+ void Died() override;
+ CommandCallback *GetDoCommandCallback() override;
+ void LoadDummyScript() override;
};
#endif /* AI_INSTANCE_HPP */
diff --git a/src/ai/ai_scanner.hpp b/src/ai/ai_scanner.hpp
index d8e8a6993..dafc340be 100644
--- a/src/ai/ai_scanner.hpp
+++ b/src/ai/ai_scanner.hpp
@@ -19,7 +19,7 @@ public:
AIScannerInfo();
~AIScannerInfo();
- /* virtual */ void Initialize();
+ void Initialize() override;
/**
* Select a random AI.
@@ -42,11 +42,11 @@ public:
void SetDummyAI(class AIInfo *info);
protected:
- /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
- /* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; }
- /* virtual */ Subdirectory GetDirectory() const { return AI_DIR; }
- /* virtual */ const char *GetScannerName() const { return "AIs"; }
- /* virtual */ void RegisterAPI(class Squirrel *engine);
+ void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
+ const char *GetFileName() const override { return PATHSEP "info.nut"; }
+ Subdirectory GetDirectory() const override { return AI_DIR; }
+ const char *GetScannerName() const override { return "AIs"; }
+ void RegisterAPI(class Squirrel *engine) override;
private:
AIInfo *info_dummy; ///< The dummy AI.
@@ -54,7 +54,7 @@ private:
class AIScannerLibrary : public ScriptScanner {
public:
- /* virtual */ void Initialize();
+ void Initialize() override;
/**
* Find a library in the pool.
@@ -65,11 +65,11 @@ public:
class AILibrary *FindLibrary(const char *library, int version);
protected:
- /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
- /* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; }
- /* virtual */ Subdirectory GetDirectory() const { return AI_LIBRARY_DIR; }
- /* virtual */ const char *GetScannerName() const { return "AI Libraries"; }
- /* virtual */ void RegisterAPI(class Squirrel *engine);
+ void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
+ const char *GetFileName() const override { return PATHSEP "library.nut"; }
+ Subdirectory GetDirectory() const override { return AI_LIBRARY_DIR; }
+ const char *GetScannerName() const override { return "AI Libraries"; }
+ void RegisterAPI(class Squirrel *engine) override;
};
#endif /* AI_SCANNER_HPP */