]> git.tdb.fi Git - libs/game.git/blob - examples/bassteroids/source/damagedealer.h
Update .gitignore files
[libs/game.git] / examples / bassteroids / source / damagedealer.h
1 #ifndef DAMAGEDEALER_H_
2 #define DAMAGEDEALER_H_
3
4 #include <msp/game/eventobserver.h>
5 #include <msp/game/handle.h>
6 #include <msp/game/system.h>
7 #include "events.h"
8
9 class Collider;
10 class Hittable;
11
12 class DamageDealer: public Msp::Game::System
13 {
14 private:
15         struct DamagingCollision
16         {
17                 Msp::Game::Handle<Hittable> entity1;
18                 Msp::Game::Handle<Hittable> entity2;
19         };
20
21         Msp::Game::EventObserver observer;
22         std::vector<DamagingCollision> collisions;
23
24 public:
25         DamageDealer(Msp::Game::Stage &);
26
27         void tick(Msp::Time::TimeDelta) override;
28
29 private:
30         void collision(const Events::Collision &);
31 };
32
33 #endif