event stuff working again. a bit too much boiler plate code but functionality counts.
This commit is contained in:
parent
2d0608b205
commit
becf8602d7
18 changed files with 235 additions and 149 deletions
|
|
@ -6,16 +6,9 @@
|
|||
namespace game {
|
||||
class ExplosionEvent : public StateUpdateEvent {
|
||||
public:
|
||||
ExplosionEvent(StateUpdateEvent::LifeCycle lifeCycle, Explosion *explosion)
|
||||
: StateUpdateEvent(lifeCycle, StateUpdateEvent::EventType::Explosion)
|
||||
, explosion(explosion)
|
||||
|
||||
ExplosionEvent(LifeCycle lifeCycle, Explosion *explosion)
|
||||
: StateUpdateEvent(lifeCycle, EventType::Explosion, explosion)
|
||||
{
|
||||
std::string typeStr = StateUpdateEvent::lifeCycleToString(lifeCycle);
|
||||
std::cout<<"created explosion event for id " << explosion->id << " of type " << typeStr << std::endl;
|
||||
}
|
||||
|
||||
public:
|
||||
const Explosion *explosion;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
14
game/state/events/missile_event.hpp
Normal file
14
game/state/events/missile_event.hpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include "state/missile.hpp"
|
||||
#include "state/state_update_event.hpp"
|
||||
|
||||
namespace game {
|
||||
class MissileEvent : public StateUpdateEvent {
|
||||
public:
|
||||
MissileEvent(LifeCycle lifeCycle, Missile *missile)
|
||||
: StateUpdateEvent(lifeCycle, EventType::Missile, missile)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
14
game/state/events/ship_event.hpp
Normal file
14
game/state/events/ship_event.hpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include "state/ship.hpp"
|
||||
#include "state/state_update_event.hpp"
|
||||
|
||||
namespace game {
|
||||
class ShipEvent : public StateUpdateEvent {
|
||||
public:
|
||||
ShipEvent(LifeCycle lifeCycle, Ship *ship)
|
||||
: StateUpdateEvent(lifeCycle, EventType::Ship, ship)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue