factored out common Unit, Projectile and GameObjectFrame behaviour into GameObject classes

This commit is contained in:
devZoGok
2023-10-01 17:20:56 +03:00
parent d62c5105cd
commit 1f82b1dfd9
18 changed files with 348 additions and 295 deletions
+3 -6
View File
@@ -1,7 +1,7 @@
#include "buildButton.h"
#include "gameManager.h"
#include "unit.h"
#include "unitFrameController.h"
#include "gameObjectFrameController.h"
#include <solUtil.h>
@@ -17,11 +17,8 @@ namespace battleship{
}
void BuildButton::onClick(){
sol::state_view SOL_LUA_STATE = generateView();
string modelPath = (string)SOL_LUA_STATE["basePath"][structureId + 1] + (string)SOL_LUA_STATE["meshPath"][structureId + 1];
UnitFrameController *ufCtr = UnitFrameController::getSingleton();
ufCtr->addUnitFrame(UnitFrameController::UnitFrame(modelPath, structureId, (int)UnitType::LAND));
GameObjectFrameController *ufCtr = GameObjectFrameController::getSingleton();
ufCtr->addGameObjectFrame(GameObjectFrameController::GameObjectFrame(structureId, (int)UnitType::LAND));
ufCtr->setPlacingFrames(true);
}
}