|
|
|
#include "olcPixelGameEngine.h"
|
|
|
|
#include "olcSoundWaveEngine.h"
|
|
|
|
#include "olcPGEX_TransformedView.h"
|
|
|
|
#include "Unit.h"
|
|
|
|
#include "Constant.h"
|
|
|
|
class VirusAttack : public olc::PixelGameEngine
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::vector<std::shared_ptr<Unit>>units;
|
|
|
|
|
|
|
|
Renderable TILE,MINIMAP_HUD,OUTLINE,MINIMAP_OUTLINE;
|
|
|
|
|
|
|
|
TileTransformedView game;
|
|
|
|
|
|
|
|
vf2d startingDragPos=CONSTANT::UNSELECTED;
|
|
|
|
void HandleDraggingSelection();
|
|
|
|
void DrawSelectionRectangle();
|
|
|
|
void HandleRightClickMove();
|
|
|
|
void CollisionChecking(std::shared_ptr<Unit>u,std::shared_ptr<Unit>u2);
|
|
|
|
void IdentifyClosestTarget(Unit*&closestUnit,float&closestDist,std::shared_ptr<Unit>u,std::shared_ptr<Unit>u2);
|
|
|
|
vf2d GetWorldMousePos();
|
|
|
|
void HandlePanAndZoom(float fElapsedTime);
|
|
|
|
void DrawMinimap();
|
|
|
|
void HandleMinimapClick();
|
|
|
|
|
|
|
|
public:
|
|
|
|
VirusAttack();
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool OnUserCreate() override;
|
|
|
|
|
|
|
|
bool OnUserUpdate(float fElapsedTime) override;
|
|
|
|
};
|