#pragma once #ifndef ACTIVE_GAME_STATE_H #define ACTIVE_GAME_STATE_H #include "guiAppState.h" #include "player.h" #include "map.h" namespace vb01{ class Node; } namespace battleship{ class ActiveGameState : public gameBase::AbstractAppState { public: ActiveGameState(GuiAppState*, std::vector players, int); ~ActiveGameState(); void onAttached(); void onDettached(); void update(); void onAction(int, bool); void onAnalog(int, float); inline void setSelectingLaunchPoint(bool s){this->selectingGuidedMissileTarget=s;} inline Player* getPlayer(){return mainPlayer;} inline std::vector& getSelectedUnits(){return selectedUnits;} inline std::vector& getUnitGroup(int i){return unitGroups[i];} private: void deselectUnits(); void renderUnits(); void updateCameraPosition(); void updateSelectionBox(); void addTarget(); void issueOrder(Order::TYPE, bool); void lookAround(bool); void orientCamera(vb01::Vector3, double); GuiAppState *guiState; std::vector players; Player *mainPlayer; vb01::Quad *dragbox = nullptr; vb01::Node *dragboxNode = nullptr; vb01::Vector2 clickPoint; std::vector unitScreenPosVec; std::vector unitLightNodes; std::vector unitGroups[9], selectedUnits; std::vector targets; bool isSelectionBox = false, shiftPressed = false, controlPressed = false, selectingPatrolPoints = false, selectingGuidedMissileTarget = false,lookingAround=false; bool isInLineOfSight(vb01::Vector3, float, Unit*); int playerId, zooms = 0; }; } #endif