HoverRace  2.0
Method.h
Go to the documentation of this file.
1 
2 // Method.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 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
25 # ifdef MR_ENGINE
26 # define MR_DllDeclare __declspec( dllexport )
27 # else
28 # define MR_DllDeclare __declspec( dllimport )
29 # endif
30 #else
31 # define MR_DllDeclare
32 #endif
33 
34 namespace HoverRace {
35  namespace Util {
36  namespace yaml {
37  class MapNode;
38  }
39  }
40 }
41 
42 namespace HoverRace {
43 namespace Script {
44 namespace Help {
45 
51 {
52 private:
53  Method() = delete;
54 public:
55  Method(const std::string &name);
56  virtual ~Method() { }
57 
58  virtual void Load(Util::yaml::MapNode *node);
59 
60 public:
61  using sigs_t = std::vector<std::string>;
62  using examples_t = std::vector<std::string>;
63 protected:
64  void SetBrief(const std::string &s);
65  void SetDesc(const std::string &s);
66  sigs_t &GetSigs() { return sigs; }
67 
68 public:
69  const std::string &GetName() const { return name; }
70  const std::string &GetBrief() const { return brief; }
71  const std::string &GetDesc() const { return desc; }
72  const sigs_t &GetSigs() const { return sigs; }
73 
74 private:
75  std::string name;
76  std::string brief;
77  std::string desc;
80 };
81 
82 } // namespace Help
83 } // namespace Script
84 } // namespace HoverRace
85 
86 #undef MR_DllDeclare
const std::string & GetBrief() const
Definition: Method.h:70
const std::string & GetName() const
Definition: Method.h:69
sigs_t & GetSigs()
Definition: Method.h:66
#define MR_DllDeclare
Definition: Method.h:31
std::string brief
Definition: Method.h:76
API documentation for a Lua method.
Definition: Method.h:50
std::vector< std::string > examples_t
Definition: Method.h:62
sigs_t sigs
Definition: Method.h:78
virtual ~Method()
Definition: Method.h:56
const sigs_t & GetSigs() const
Definition: Method.h:72
Definition: MapNode.h:34
examples_t examples
Definition: Method.h:79
Definition: Announcement.h:24
std::string desc
Definition: Method.h:77
std::string name
Definition: Method.h:75
std::vector< std::string > sigs_t
Definition: Method.h:61
const std::string & GetDesc() const
Definition: Method.h:71