From 07a2eb4d98a72dd38fba5086cee433083d335a38 Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 24 Oct 2018 11:02:13 -0700 Subject: [PATCH] Instances call constructor of base class --- BaseButtonInstance.cpp | 1 + DataModelInstance.cpp | 1 + ImageButtonInstance.cpp | 2 +- PhysicalInstance.cpp | 2 ++ TextButtonInstance.cpp | 1 + WorkspaceInstance.cpp | 4 +++- WorkspaceInstance.h | 1 + 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/BaseButtonInstance.cpp b/BaseButtonInstance.cpp index ff411f5..55e54ca 100644 --- a/BaseButtonInstance.cpp +++ b/BaseButtonInstance.cpp @@ -6,6 +6,7 @@ ButtonListener* listener = NULL; BaseButtonInstance::BaseButtonInstance(void) { + Instance::Instance(); listener = NULL; } diff --git a/DataModelInstance.cpp b/DataModelInstance.cpp index cc4ad49..4cba7db 100644 --- a/DataModelInstance.cpp +++ b/DataModelInstance.cpp @@ -6,6 +6,7 @@ DataModelInstance::DataModelInstance(void) { + Instance::Instance(); workspace = new WorkspaceInstance(); guiRoot = new Instance(); children.push_back(workspace); diff --git a/ImageButtonInstance.cpp b/ImageButtonInstance.cpp index 897cc9b..e0fc785 100644 --- a/ImageButtonInstance.cpp +++ b/ImageButtonInstance.cpp @@ -2,7 +2,7 @@ ImageButtonInstance::ImageButtonInstance(G3D::TextureRef newImage, G3D::TextureRef overImage = NULL, G3D::TextureRef downImage = NULL, G3D::TextureRef disableImage = NULL) { - + BaseButtonInstance::BaseButtonInstance(); image = newImage; openGLID = image->getOpenGLID(); image_ovr = overImage; diff --git a/PhysicalInstance.cpp b/PhysicalInstance.cpp index 6e1963d..dd0430a 100644 --- a/PhysicalInstance.cpp +++ b/PhysicalInstance.cpp @@ -4,6 +4,7 @@ PhysicalInstance::PhysicalInstance(void) { + Instance::Instance(); name = "Default PhysicalInstance"; className = "Part"; canCollide = true; @@ -23,6 +24,7 @@ PhysicalInstance::PhysicalInstance(void) PhysicalInstance::PhysicalInstance(const PhysicalInstance &oinst) { + Instance::Instance(oinst); name = oinst.name; className = "Part"; canCollide = oinst.canCollide; diff --git a/TextButtonInstance.cpp b/TextButtonInstance.cpp index 349b439..6c8cfd1 100644 --- a/TextButtonInstance.cpp +++ b/TextButtonInstance.cpp @@ -3,6 +3,7 @@ TextButtonInstance::TextButtonInstance(void) { + BaseButtonInstance::BaseButtonInstance(); boxBegin = Vector2(0,0); boxEnd = Vector2(0,0); fontLocationRelativeTo = Vector2(0,0); diff --git a/WorkspaceInstance.cpp b/WorkspaceInstance.cpp index f4cf49e..2f4d463 100644 --- a/WorkspaceInstance.cpp +++ b/WorkspaceInstance.cpp @@ -3,7 +3,9 @@ WorkspaceInstance::WorkspaceInstance(void) { - className = "Workspace"; + Instance::Instance(); + name = "Instance"; + className = "Level"; timer = 60.0F; score = 0; } diff --git a/WorkspaceInstance.h b/WorkspaceInstance.h index fdb4b78..26a5bc4 100644 --- a/WorkspaceInstance.h +++ b/WorkspaceInstance.h @@ -9,4 +9,5 @@ public: int score; WorkspaceInstance(void); ~WorkspaceInstance(void); + };