40 lines
774 B
C++
40 lines
774 B
C++
#include <iostream>
|
|
#include "Entity.h"
|
|
#include "Monster.h"
|
|
#include "Vector3.h"
|
|
#include "Ork.h"
|
|
|
|
using namespace MyNamespace;
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
Entity entity; // this is an instance
|
|
cout << entity.ToString() << endl;
|
|
|
|
// can't be instantiated, because it is abstract
|
|
//Monster monster;
|
|
//cout << monster.ToString() << endl;
|
|
|
|
Vector3 position(1.0f, 0.0f, 2.0f);
|
|
Vector3 position2 = Vector3();
|
|
Vector3 position3{}; // list-initializer
|
|
|
|
Ork ork;
|
|
ork.Move(position);
|
|
|
|
Monster* pMonster = new Ork();
|
|
delete pMonster;
|
|
pMonster = nullptr;
|
|
|
|
ICompareable* pCompareables[] = { new Ork, new Ork, new Ork };
|
|
for (size_t i = 0; i < size(pCompareables); i++)
|
|
{
|
|
delete pCompareables[i];
|
|
pCompareables[i] = nullptr;
|
|
}
|
|
|
|
Ork ork2 = ork;
|
|
|
|
return 0;
|
|
} |