mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
placeable frames of structures to be built
This commit is contained in:
+13
-2
@@ -13,6 +13,15 @@ namespace vb01{
|
||||
namespace battleship{
|
||||
class ActiveGameState : public gameBase::AbstractAppState {
|
||||
public:
|
||||
struct StructureFrame{
|
||||
vb01::Model *model;
|
||||
int id, type;
|
||||
bool canPlace;
|
||||
|
||||
StructureFrame(std::string, int, int);
|
||||
~StructureFrame();
|
||||
};
|
||||
|
||||
ActiveGameState(GuiAppState*, std::vector<Player*> players, int);
|
||||
~ActiveGameState();
|
||||
void onAttached();
|
||||
@@ -20,7 +29,7 @@ namespace battleship{
|
||||
void update();
|
||||
void onAction(int, bool);
|
||||
void onAnalog(int, float);
|
||||
inline bool isPlacingStructure(){return placingStructure;}
|
||||
inline bool isPlacingStructures(){return placingStructures;}
|
||||
inline void setSelectingLaunchPoint(bool s){this->selectingGuidedMissileTarget=s;}
|
||||
inline Player* getPlayer(){return mainPlayer;}
|
||||
inline std::vector<Unit*>& getSelectedUnits(){return selectedUnits;}
|
||||
@@ -32,6 +41,7 @@ namespace battleship{
|
||||
void renderUnits();
|
||||
void updateCameraPosition();
|
||||
void updateSelectionBox();
|
||||
void updateStructureFrames();
|
||||
void addTarget();
|
||||
void issueOrder(Order::TYPE, bool);
|
||||
void lookAround(bool);
|
||||
@@ -40,6 +50,7 @@ namespace battleship{
|
||||
|
||||
GuiAppState *guiState;
|
||||
std::vector<Player*> players;
|
||||
std::vector<StructureFrame> structureFrames;
|
||||
Player *mainPlayer;
|
||||
vb01::Quad *dragbox = nullptr;
|
||||
vb01::Node *dragboxNode = nullptr, *textNode = nullptr;
|
||||
@@ -48,7 +59,7 @@ namespace battleship{
|
||||
std::vector<vb01::Node*> unitLightNodes;
|
||||
std::vector<Unit*> unitGroups[9], selectedUnits;
|
||||
std::vector<Order::Target> targets;
|
||||
bool isSelectionBox = false, shiftPressed = false, controlPressed = false, selectingPatrolPoints = false, selectingGuidedMissileTarget = false, lookingAround = false, placingStructure = false;
|
||||
bool isSelectionBox = false, shiftPressed = false, controlPressed = false, selectingPatrolPoints = false, selectingGuidedMissileTarget = false, lookingAround = false, placingStructures = false;
|
||||
int playerId, zooms = 0;
|
||||
const int NUM_MAX_ZOOMS = 10;
|
||||
float depth = 1;
|
||||
|
||||
Reference in New Issue
Block a user