ULTIMA: Added override keywords

This commit is contained in:
Eugene Sandulenko 2020-02-02 22:20:54 +01:00
parent 95714e95ce
commit 2b17ee563c
14 changed files with 28 additions and 22 deletions

View File

@ -64,14 +64,15 @@ public:
#define CLASSDEF \
static ::Ultima::Shared::ClassDef type(); \
virtual ::Ultima::Shared::ClassDef getType() const { return type(); }
virtual ::Ultima::Shared::ClassDef getType() const override { return type(); }
/**
* Defines the most basic root of the engine's object hierarchy.
*/
class BaseObject {
public:
CLASSDEF
static ::Ultima::Shared::ClassDef type();
virtual ::Ultima::Shared::ClassDef getType() const { return type(); }
virtual ~BaseObject() {
}

View File

@ -44,6 +44,11 @@ struct MSGMAP {
};
#define DECLARE_MESSAGE_MAP \
protected: \
static const Ultima::Shared::MSGMAP *getThisMessageMap(); \
virtual const Ultima::Shared::MSGMAP *getMessageMap() const override
#define DECLARE_MESSAGE_MAP_BASE \
protected: \
static const Ultima::Shared::MSGMAP *getThisMessageMap(); \
virtual const Ultima::Shared::MSGMAP *getMessageMap() const
@ -91,7 +96,7 @@ protected: \
* that can receive messages
*/
class MessageTarget: public BaseObject {
DECLARE_MESSAGE_MAP;
DECLARE_MESSAGE_MAP_BASE;
public:
CLASSDEF;
};

View File

@ -43,7 +43,7 @@ public:
/**
* Gets the name of the item, if any
*/
virtual const Common::String getName() const { return _name; }
virtual const Common::String getName() const override { return _name; }
};
} // End of namespace Shared

View File

@ -91,7 +91,7 @@ public:
* @param isPreUpdate Update is called twice in succesion during the end of turn update.
* Once with true for all widgets, then with it false
*/
virtual void update(bool isPreUpdate);
virtual void update(bool isPreUpdate) override;
/**
* True true if the creature is dead

View File

@ -66,7 +66,7 @@ protected:
/**
* Do the attack in a given direction
*/
virtual void doAttack(Shared::Maps::Direction dir);
virtual void doAttack(Shared::Maps::Direction dir) override;
public:
CLASSDEF;
@ -86,7 +86,7 @@ protected:
/**
* Do the attack in a given direction
*/
virtual void doAttack(Shared::Maps::Direction dir);
virtual void doAttack(Shared::Maps::Direction dir) override;
public:
CLASSDEF;

View File

@ -62,7 +62,7 @@ public:
/**
* Returns true if the current video mode is VGA
*/
virtual bool isVGA() const { return _videoMode == VIDEOMODE_VGA; }
virtual bool isVGA() const override { return _videoMode == VIDEOMODE_VGA; }
/**
* Called when the game starts
@ -72,7 +72,7 @@ public:
/**
* Returns true if the game can currently be saved
*/
virtual bool canSaveGameStateCurrently();
virtual bool canSaveGameStateCurrently() override;
/**
* Give some treasure

View File

@ -95,7 +95,7 @@ public:
/**
* Clears all map data
*/
virtual void clear();
virtual void clear() override;
/**
* Load a given map

View File

@ -50,7 +50,7 @@ public:
* Constructor
*/
MapBase(Ultima1Game *game, Ultima1Map *map);
/**
* Destructor
*/
@ -112,7 +112,7 @@ public:
/**
* Cast a specific spell
*/
virtual void castSpell(uint spell);
virtual void castSpell(uint spell) override;
/**
* Handles dropping an amount of coins

View File

@ -76,12 +76,12 @@ public:
/**
* Handles loading and saving viewport
*/
void synchronize(Common::Serializer &s);
void synchronize(Common::Serializer &s) override;
/**
* Load the map
*/
virtual void load(Shared::Maps::MapId mapId);
virtual void load(Shared::Maps::MapId mapId) override;
/**
* Gets a tile at a given position
@ -103,7 +103,7 @@ public:
/**
* Updates the map at the end of a turn
*/
void update();
void update() override;
/**
* Spawns a monster within dungeons

View File

@ -46,7 +46,7 @@ public:
/**
* Load the map
*/
virtual void load(Shared::Maps::MapId mapId);
virtual void load(Shared::Maps::MapId mapId) override;
/**
* Returns whether the map wraps around to the other side at it's edges (i.e. the overworld)

View File

@ -53,7 +53,7 @@ public:
/**
* Update the cursor
*/
virtual void update();
virtual void update() override;
/**
* Draw the cursor

View File

@ -61,7 +61,7 @@ public:
/**
* Talk to an NPC
*/
virtual void talk();
virtual void talk() override;
/**
* Removes hit points from a creature

View File

@ -163,7 +163,7 @@ public:
/**
* Get the name of a transport's weapons
*/
virtual Common::String getWeaponsName();
virtual Common::String getWeaponsName() override;
/**
* Get the tile for the transport method
@ -188,7 +188,7 @@ public:
/**
* Get the name of a transport's weapons
*/
virtual Common::String getWeaponsName();
virtual Common::String getWeaponsName() override;
/**
* Get the tile for the transport method

View File

@ -31,7 +31,7 @@ namespace Ultima1 {
namespace Widgets {
/**
* Base class for widgets in urban maps
* Base class for widgets in urban maps
*/
class UrbanWidget : public Shared::Maps::MapWidget {
DECLARE_MESSAGE_MAP;
@ -66,7 +66,7 @@ public:
/**
* Returns true if the given widget can move to a given position on the map
*/
virtual CanMove canMoveTo(const Point &destPos);
virtual CanMove canMoveTo(const Point &destPos) override;
/**
* Handles loading and saving games