ManaPlus
beingcommon.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2013-2019 The ManaPlus Developers
4  *
5  * This file is part of The ManaPlus Client.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef RESOURCES_BEINGCOMMON_H
22 #define RESOURCES_BEINGCOMMON_H
23 
24 #include "fs/virtfs/tools.h"
25 
26 #include "utils/foreach.h"
27 #include "utils/xml.h"
28 
29 #include "localconsts.h"
30 
31 UTILS_FOREACH_H
32 UTILS_VIRTFSTOOLS_H
33 
34 class BeingInfo;
35 
36 struct SpriteDisplay;
37 
38 #define loadXmlDir(name, function) \
39  { \
40  StringVect listVect; \
41  VirtFs::getFilesInDir(paths.getStringValue( \
42  name), listVect, ".xml"); \
43  FOR_EACH (StringVectCIter, itVect, listVect) \
44  { \
45  function(*itVect, SkipError_true); \
46  } \
47  }
48 
49 #define loadXmlDir2(name, function, ext, skipError) \
50  { \
51  StringVect listVect; \
52  VirtFs::getFilesInDir(name, listVect, ext); \
53  FOR_EACH (StringVectCIter, itVect, listVect) \
54  { \
55  function(*itVect, skipError); \
56  } \
57  }
58 
59 namespace BeingCommon
60 {
62  XmlNodePtrConst node,
63  const std::string &hoverCursor) A_NONNULL(1);
64 
66  XmlNodePtrConst node,
67  const int moreBlockFlags) A_NONNULL(1);
68 
69  void readAiAttributes(BeingInfo *const info,
70  XmlNodePtrConst node);
71 
72  void getIncludeFiles(const std::string &dir,
73  StringVect &list,
74  const std::string &ext);
75 
76  bool readObjectNodes(XmlNodePtrConst &spriteNode,
77  SpriteDisplay &display,
78  BeingInfo *const currentInfo,
79  const std::string &dbName) A_NONNULL(3);
80 } // namespace BeingCommon
81 
82 #endif // RESOURCES_BEINGCOMMON_H
BeingInfo
Definition: beinginfo.h:52
BeingCommon::readAiAttributes
void readAiAttributes(BeingInfo *const info, xmlNode *const node)
Definition: beingcommon.cpp:95
StringVect
std::vector< std::string > StringVect
Definition: stringvector.h:28
xml.h
localconsts.h
Actions::info
bool info(InputEvent &event)
Definition: commands.cpp:56
BeingCommon::getIncludeFiles
void getIncludeFiles(const std::string &dir, StringVect &list, const std::string &ext)
SpriteDisplay
Definition: spritedisplay.h:32
BeingCommon::readBasicAttributes
void readBasicAttributes(BeingInfo *const info, xmlNode *const node, const std::string &hoverCursor)
Definition: beingcommon.cpp:36
foreach.h
BeingCommon
Definition: beingcommon.h:59
BeingCommon::readObjectNodes
bool readObjectNodes(xmlNode *const &spriteNode, SpriteDisplay &display, BeingInfo *const currentInfo, const std::string &dbName)
Definition: beingcommon.cpp:139
BeingCommon::readWalkingAttributes
void readWalkingAttributes(BeingInfo *const info, xmlNode *const node, const int moreBlockFlags)
Definition: beingcommon.cpp:59
tools.h
A_NONNULL
#define A_NONNULL(...)
Definition: localconsts.h:167