add example for "default constructor, copy constructor, destructor, if you need one you'll need all"
add smart pointer add pointer pointer
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "Entity.h"
|
||||
#include "ICompareable.h"
|
||||
#include "Weapon.h"
|
||||
|
||||
//enum Monsters
|
||||
//{
|
||||
@@ -12,6 +14,9 @@
|
||||
class Monster : public Entity, public ICompareable
|
||||
{
|
||||
public:
|
||||
// internal pointers often requires a default & copy constructor and a destructor
|
||||
Monster();
|
||||
Monster(const Monster& other);
|
||||
Monster(int strength);
|
||||
virtual ~Monster();
|
||||
|
||||
@@ -22,6 +27,8 @@ public:
|
||||
int Compare(ICompareable* other) override;
|
||||
|
||||
protected:
|
||||
Weapon* _pWeapon = nullptr;
|
||||
|
||||
int _strength = 0;
|
||||
float _speed = 0.0f;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user