Recast  1
Game with custom magic
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
HeatEvent.hpp
Go to the documentation of this file.
1 
8 #ifndef RECAST_SERVER_HEATEVENT_H
9 #define RECAST_SERVER_HEATEVENT_H
10 
11 #include <io/configs/Config.hpp>
12 #include "IEvent.hpp"
13 
14 class HeatEvent : public IEvent {
15 public:
16  HeatEvent(SpellNode *node, float temp) : IEvent(node), temp(temp) {};
17 
18  static float getTempFromEnergy(float energyEjection) {
19  return Config::g("spell.heater.temp_per_energy", 1) * energyEjection;
20  }
21 
22  void commit(Box2DWorld *world, SpellEntity *entity, std::shared_ptr<TempWorld> tempWorld);
23 
24 private:
25  float temp;
26 
27 };
28 
29 
30 #endif //RECAST_SERVER_HEATEVENT_H
HeatEvent(SpellNode *node, float temp)
Definition: HeatEvent.hpp:16
void commit(Box2DWorld *world, SpellEntity *entity, std::shared_ptr< TempWorld > tempWorld)
Definition: HeatEvent.cpp:12
Definition: SpellEntity.h:16
Config file.
Definition: IEvent.hpp:18
static float getTempFromEnergy(float energyEjection)
Definition: HeatEvent.hpp:18
Definition: Box2DWorld.h:26
Definition: SpellNode.hpp:23
Definition: HeatEvent.hpp:14
static T g(const std::string &key, T defaultVar)
Definition: Config.hpp:59