-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnemyGroup.h
46 lines (32 loc) · 847 Bytes
/
EnemyGroup.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include <vector>
#include <iterator>
#include <memory>
#include <time.h>
#include <stdlib.h>
#include "Enemy.h"
#include "Bullet.h"
#include "BackBuffer.h"
class EnemyGroup
{
public:
using Iter = std::vector<std::unique_ptr<EnemyBullet>>::iterator;
using ConstIter = std::vector<std::unique_ptr<EnemyBullet>>::const_iterator;
EnemyGroup(const BackBuffer * aBackBuffer);
void GenerateEnemies();
bool HandleBullet(Bullet & aBullet);
bool IsEmpty() const;
void Draw();
void ShootRandom();
void Update(float aTimeElapsed);
Iter begin();
Iter end();
ConstIter cbegin() const;
ConstIter cend() const;
private:
static const int kEnemyNumber;
static const int kEnemiesOnLine;
std::vector<std::unique_ptr<Enemy>> mEnemies;
std::vector<std::unique_ptr<EnemyBullet>> mBullets;
const BackBuffer * mBackBuffer;
};