add smart pointers
add polymorphism add destructor & copy constructor add pointer-pointer
This commit is contained in:
@@ -1,11 +1,24 @@
|
||||
#pragma once
|
||||
#include "Entity.h"
|
||||
#include "ICompareable.h"
|
||||
#include "Vector3.h"
|
||||
#include "Weapon.h"
|
||||
|
||||
class Monster : public Entity
|
||||
class Monster : public Entity, public ICompareable
|
||||
{
|
||||
public:
|
||||
// default constructor, copy constructor & destructor if you need one you'll need all of them
|
||||
// internal pointers often requires default & copy constructor & a destructor at the same time
|
||||
Monster();
|
||||
Monster(const Monster& other); // copy constructor
|
||||
virtual ~Monster();
|
||||
|
||||
std::string toString() override { return "Monster"; }
|
||||
|
||||
virtual void Move(Vector3 move) = 0;
|
||||
int Compare(ICompareable* pOther) override;
|
||||
|
||||
private:
|
||||
Weapon* _pWeapon = nullptr;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user