HoverRace  2.0
Class.h
Go to the documentation of this file.
1 
2 // Class.h
3 //
4 // Copyright (c) 2010, 2015-2016 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include "Method.h"
25 
26 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
27 # ifdef MR_ENGINE
28 # define MR_DllDeclare __declspec( dllexport )
29 # else
30 # define MR_DllDeclare __declspec( dllimport )
31 # endif
32 #else
33 # define MR_DllDeclare
34 #endif
35 
36 namespace HoverRace {
37  namespace Util {
38  namespace yaml {
39  class MapNode;
40  }
41  }
42 }
43 
44 namespace HoverRace {
45 namespace Script {
46 namespace Help {
47 
53 {
54 private:
55  Class() = delete;
56 public:
57  Class(const std::string &name);
58 
59  void Load(Util::yaml::MapNode *node);
60 
61 public:
62  const std::string &GetName() const { return name; }
63 
64 public:
65  using methods_t = std::map<const std::string, std::shared_ptr<Method>>;
66  const methods_t &GetMethods() const { return methods; }
67 
68  void AddMethod(std::shared_ptr<Method> method);
69  std::shared_ptr<Method> GetMethod(const std::string &methodName) const;
70 
71 private:
72  std::string name;
74 };
75 
76 } // namespace Help
77 } // namespace Script
78 } // namespace HoverRace
79 
80 #undef MR_DllDeclare
#define MR_DllDeclare
Definition: Class.h:33
std::string name
Definition: Class.h:72
std::map< const std::string, std::shared_ptr< Method >> methods_t
Definition: Class.h:65
Definition: MapNode.h:34
API documentation for a Lua class.
Definition: Class.h:52
Definition: Announcement.h:24
methods_t methods
Definition: Class.h:73
const std::string & GetName() const
Definition: Class.h:62
const methods_t & GetMethods() const
Definition: Class.h:66