Changed the way of getting an instance type

This commit is contained in:
andreja6
2018-04-11 06:42:11 -07:00
parent 59f6652396
commit 2b508cd017
5 changed files with 8 additions and 12 deletions

Binary file not shown.

View File

@@ -3,9 +3,7 @@
std::string name; std::string name;
Instance* parent; Instance* parent;
static const int BASE_INSTANCE = 0; static const std::string className = "Instance";
static const int PHYSICAL_INSTANCE = 1;
static const int type = BASE_INSTANCE;
Instance::Instance(void) Instance::Instance(void)
{ {
@@ -16,10 +14,7 @@ Instance::~Instance(void)
{ {
name = "Default Game Instance"; name = "Default Game Instance";
} }
int getType()
{
return type;
}

View File

@@ -10,4 +10,5 @@ public:
Instance* parent; // Another pointer. Instance* parent; // Another pointer.
static const int BASE_INSTANCE; static const int BASE_INSTANCE;
static const int PHYSICAL_INSTANCE; static const int PHYSICAL_INSTANCE;
static int type;
}; };

View File

@@ -1,22 +1,22 @@
#include <G3DAll.h> #include <G3DAll.h>
#include "PhysicalInstance.h" #include "PhysicalInstance.h"
static const std::string className = "Part";
bool collides = true; bool canCollide = true;
bool anchored = false; bool anchored = false;
Vector3 size; Vector3 size;
Vector3 position; Vector3 position;
Color3 color; Color3 color;
//static const int type = PHYSICAL_INSTANCE;
PhysicalInstance::PhysicalInstance(void) PhysicalInstance::PhysicalInstance(void)
{ {
name = "Default PhysicalInstance"; name = "Default PhysicalInstance";
collides = true; canCollide = true;
anchored = true; anchored = true;
size = Vector3(2,1,4); size = Vector3(2,1,4);
position = Vector3(0,0,0); position = Vector3(0,0,0);
color = Color3::gray(); color = Color3::gray();
} }
PhysicalInstance::~PhysicalInstance(void) PhysicalInstance::~PhysicalInstance(void)

View File

@@ -99,7 +99,7 @@ void Demo::onInit() {
//dataModel->name = "undefined"; //dataModel->name = "undefined";
dataModel->parent = NULL; dataModel->parent = NULL;
PhysicalInstance* test = new PhysicalInstance(); Instance* test = new PhysicalInstance();
setDesiredFrameRate(FPSVal[index]); setDesiredFrameRate(FPSVal[index]);
app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.setPosition(Vector3(0, 2, 10));
app->debugCamera.lookAt(Vector3(0, 2, 0)); app->debugCamera.lookAt(Vector3(0, 2, 0));