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,19 +1,24 @@
|
||||
#include "Ork.h"
|
||||
#include <iostream>
|
||||
|
||||
Ork::Ork() : Monster(10)
|
||||
{
|
||||
std::cout << "Create Ork" << std::endl;
|
||||
|
||||
//this->_strength = 10;
|
||||
this->name = "My Ork";
|
||||
}
|
||||
|
||||
Ork::Ork(const Ork& other) : Monster(other._strength)
|
||||
Ork::Ork(const Ork& other) : Monster(other)
|
||||
{
|
||||
this->name = other.name;
|
||||
this->_speed = other._speed;
|
||||
std::cout << "Create a copy of an Ork" << std::endl;
|
||||
//this->name = other.name;
|
||||
//this->_speed = other._speed;
|
||||
}
|
||||
|
||||
Ork::~Ork()
|
||||
{
|
||||
std::cout << "Destroy Ork" << std::endl;
|
||||
}
|
||||
|
||||
void Ork::Move()
|
||||
|
||||
Reference in New Issue
Block a user