2021-12-20 22:22:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "LevelGUI.h"
|
|
|
|
#include "Plane.h"
|
|
|
|
#include "Bomb.h"
|
|
|
|
#include "Ground.h"
|
|
|
|
#include "Tank.h"
|
|
|
|
|
|
|
|
class SBomber
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SBomber();
|
|
|
|
~SBomber();
|
2021-12-25 05:46:23 +00:00
|
|
|
|
|
|
|
inline bool GetExitFlag() const
|
|
|
|
{
|
|
|
|
return exitFlag;
|
|
|
|
}
|
2021-12-20 22:22:05 +00:00
|
|
|
|
|
|
|
void ProcessKBHit();
|
|
|
|
void TimeStart();
|
|
|
|
void TimeFinish();
|
|
|
|
|
|
|
|
void DrawFrame();
|
|
|
|
void MoveObjects();
|
|
|
|
void CheckObjects();
|
|
|
|
|
2021-12-25 05:46:23 +00:00
|
|
|
void run();
|
2021-12-20 22:22:05 +00:00
|
|
|
|
2021-12-25 05:46:23 +00:00
|
|
|
private:
|
2021-12-20 22:22:05 +00:00
|
|
|
void CheckPlaneAndLevelGUI();
|
|
|
|
void CheckBombsAndGround();
|
2021-12-25 05:46:23 +00:00
|
|
|
void CheckDestoyableObjects(Bomb *pBomb);
|
2021-12-20 22:22:05 +00:00
|
|
|
|
2021-12-25 05:46:23 +00:00
|
|
|
// void DeleteDynamicObj(DynamicObject *pBomb);
|
|
|
|
// void DeleteStaticObj(GameObject *pObj);
|
2021-12-20 22:22:05 +00:00
|
|
|
|
2021-12-25 05:46:23 +00:00
|
|
|
Ground* FindGround() const;
|
|
|
|
Plane* FindPlane() const;
|
|
|
|
LevelGUI* FindLevelGUI() const;
|
2021-12-20 22:22:05 +00:00
|
|
|
std::vector<DestroyableGroundObject*> FindDestoyableGroundObjects() const;
|
|
|
|
std::vector<Bomb*> FindAllBombs() const;
|
|
|
|
|
2021-12-25 05:46:23 +00:00
|
|
|
// void DropBomb();
|
2021-12-20 22:22:05 +00:00
|
|
|
|
|
|
|
std::vector<DynamicObject*> vecDynamicObj;
|
|
|
|
std::vector<GameObject*> vecStaticObj;
|
2021-12-25 05:46:23 +00:00
|
|
|
|
2021-12-20 22:22:05 +00:00
|
|
|
bool exitFlag;
|
|
|
|
|
|
|
|
uint64_t startTime, finishTime, passedTime;
|
|
|
|
uint16_t bombsNumber, deltaTime, fps;
|
|
|
|
int16_t score;
|
2021-12-25 05:46:23 +00:00
|
|
|
};
|