mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
factored out common Unit, Projectile and GameObjectFrame behaviour into GameObject classes
This commit is contained in:
+3
-6
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user