Roguelike
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
skillmanager.h
Go to the documentation of this file.
1 #ifndef ROGUELIKE_ACTION_SKILL_SKILLMANAGER_H_
2 #define ROGUELIKE_ACTION_SKILL_SKILLMANAGER_H_
3 
4 // Inheritance
5 // (none)
6 
7 // External Dependencies
8 #include <ugdk/base/genericcontainer.h>
9 
10 // Internal Dependencies
12 
13 // Forward Declarations
14 #include "game/base.h"
15 
16 namespace game {
17 namespace action {
18 namespace skill {
19 
20 class SkillManager : public ugdk::base::GenericContainer<Skill*> {
21  typedef ugdk::base::GenericContainer<Skill*> super;
22  // singleton
23  static SkillManager* reference_;
24  SkillManager();
25 
26  public:
27  static SkillManager* reference() {
28  return reference_ == nullptr
29  ? (reference_ = new SkillManager())
30  : reference_ ;
31  }
32  ~SkillManager();
33 
34 
35  time::TimeElapsed Cast(const std::string& skill, base::GameObject* caster, const GameTargets& targets) {
36  return (*Find(skill))(caster, targets);
37  }
38  time::TimeElapsed Cast(const std::string& skill, base::GameObject* caster, const ugdk::math::Integer2D& target) {
39  return (*Find(skill))(caster, target);
40  }
41  time::TimeElapsed Cast(const std::string& skill, base::GameObject* caster, base::GameObject* target) {
42  return (*Find(skill))(caster, target);
43  }
44  time::TimeElapsed Cast(const std::string& skill, base::GameObject* caster) {
45  return (*Find(skill))(caster);
46  }
47 };
48 
49 } // namespace skill
50 } // namespace action
51 } // namespace game
52 
53 #endif /* ROGUELIKE_ACTION_SKILL_SKILLMANAGER_H_ */
Definition: gameobject.h:53
time::TimeElapsed Cast(const std::string &skill, base::GameObject *caster, const GameTargets &targets)
Definition: skillmanager.h:35
Definition: aim.cc:15
time::TimeElapsed Cast(const std::string &skill, base::GameObject *caster, const ugdk::math::Integer2D &target)
Definition: skillmanager.h:38
~SkillManager()
Definition: skillmanager.cc:37
Definition: timeelapsed.h:20
time::TimeElapsed Cast(const std::string &skill, base::GameObject *caster)
Definition: skillmanager.h:44
static SkillManager * reference()
Definition: skillmanager.h:27
Definition: skillmanager.h:20
time::TimeElapsed Cast(const std::string &skill, base::GameObject *caster, base::GameObject *target)
Definition: skillmanager.h:41
std::list< base::GameThing > GameTargets
Definition: skill.h:24