mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
vcmi: modernize lib/mapObjects
This commit is contained in:
@@ -28,15 +28,14 @@ class JsonNode;
|
||||
|
||||
// This one teleport-specific, but has to be available everywhere in callbacks and netpacks
|
||||
// For now it's will be there till teleports code refactored and moved into own file
|
||||
typedef std::vector<std::pair<ObjectInstanceID, int3>> TTeleportExitsList;
|
||||
using TTeleportExitsList = std::vector<std::pair<ObjectInstanceID, int3>>;
|
||||
|
||||
class DLL_LINKAGE IObjectInterface
|
||||
{
|
||||
public:
|
||||
static IGameCallback *cb;
|
||||
|
||||
IObjectInterface();
|
||||
virtual ~IObjectInterface();
|
||||
virtual ~IObjectInterface() = default;
|
||||
|
||||
virtual int32_t getObjGroupIndex() const = 0;
|
||||
virtual int32_t getObjTypeIndex() const = 0;
|
||||
@@ -77,7 +76,7 @@ public:
|
||||
const CGObjectInstance *o;
|
||||
|
||||
IBoatGenerator(const CGObjectInstance *O);
|
||||
virtual ~IBoatGenerator() {}
|
||||
virtual ~IBoatGenerator() = default;
|
||||
|
||||
virtual int getBoatType() const; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral
|
||||
virtual void getOutOffsets(std::vector<int3> &offsets) const =0; //offsets to obj pos when we boat can be placed
|
||||
@@ -97,7 +96,6 @@ class DLL_LINKAGE IShipyard : public IBoatGenerator
|
||||
{
|
||||
public:
|
||||
IShipyard(const CGObjectInstance *O);
|
||||
virtual ~IShipyard() {}
|
||||
|
||||
virtual void getBoatCost(std::vector<si32> &cost) const;
|
||||
|
||||
@@ -132,8 +130,8 @@ public:
|
||||
std::string typeName;
|
||||
std::string subTypeName;
|
||||
|
||||
CGObjectInstance();
|
||||
~CGObjectInstance();
|
||||
CGObjectInstance(); //TODO: remove constructor
|
||||
~CGObjectInstance() override;
|
||||
|
||||
int32_t getObjGroupIndex() const override;
|
||||
int32_t getObjTypeIndex() const override;
|
||||
@@ -145,7 +143,7 @@ public:
|
||||
{
|
||||
return this->tempOwner;
|
||||
}
|
||||
void setOwner(PlayerColor ow);
|
||||
void setOwner(const PlayerColor & ow);
|
||||
|
||||
/** APPEARANCE ACCESSORS **/
|
||||
|
||||
@@ -195,7 +193,7 @@ public:
|
||||
void initObj(CRandomGenerator & rand) override;
|
||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||
/// method for synchronous update. Note: For new properties classes should override setPropertyDer instead
|
||||
void setProperty(ui8 what, ui32 val) override final;
|
||||
void setProperty(ui8 what, ui32 val) final;
|
||||
|
||||
virtual void afterAddToMap(CMap * map);
|
||||
virtual void afterRemoveFromMap(CMap * map);
|
||||
@@ -225,7 +223,7 @@ protected:
|
||||
virtual void setPropertyDer(ui8 what, ui32 val);
|
||||
|
||||
/// Gives dummy bonus from this object to hero. Can be used to track visited state
|
||||
void giveDummyBonus(ObjectInstanceID heroID, ui8 duration = Bonus::ONE_DAY) const;
|
||||
void giveDummyBonus(const ObjectInstanceID & heroID, ui8 duration = Bonus::ONE_DAY) const;
|
||||
|
||||
///Serialize object-type specific options
|
||||
virtual void serializeJsonOptions(JsonSerializeFormat & handler);
|
||||
|
||||
Reference in New Issue
Block a user