Pol  Revision:cb584c9
npctmpl.h
Go to the documentation of this file.
1 
8 #ifndef NPCTMPL_H
9 #define NPCTMPL_H
10 
11 #include <map>
12 #include <stddef.h>
13 #include <string>
14 
15 #include "../clib/cfgelem.h"
16 #include "../clib/cfgfile.h"
17 #include "../clib/compilerspecifics.h"
18 
19 namespace Pol
20 {
21 namespace Plib
22 {
23 class Package;
24 }
25 namespace Items
26 {
27 class UArmor;
28 class UWeapon;
29 }
30 namespace Core
31 {
32 class ExportScript;
33 
35 {
36 public:
37  std::string name;
38 
42 
43  // std::string script;
44  enum ALIGNMENT : u8
45  {
48  GOOD
49  } alignment;
50 
52 
53  NpcTemplate( const Clib::ConfigElem& elem, const Plib::Package* pkg );
54  size_t estimateSize() const;
55  ~NpcTemplate();
56 };
57 
58 const NpcTemplate& find_npc_template( const Clib::ConfigElem& elem );
59 bool FindNpcTemplate( const char* template_name, Clib::ConfigElem& elem );
60 bool FindNpcTemplate( const char* template_name, Clib::ConfigFile& cf, Clib::ConfigElem& elem );
61 
63 {
64 public:
67  size_t estimateSize() const;
68  virtual void display_error( const std::string& msg, bool show_curline = true,
69  const Clib::ConfigElemBase* elem = nullptr,
70  bool error = true ) const POL_OVERRIDE;
71 
72 private:
73  std::string _filename;
74  unsigned _fileline;
75 };
76 
78 {
79 public:
81  NpcTemplateElem( const Clib::ConfigFile& cf, const Clib::ConfigElem& elem );
82  size_t estimateSize() const;
83  void copyto( Clib::ConfigElem& elem ) const;
84 
85 private:
88 };
89 }
90 }
91 #endif
unsigned char u8
Definition: rawtypes.h:25
#define POL_OVERRIDE
const Plib::Package * pkg
Definition: npctmpl.h:41
bool FindNpcTemplate(const char *template_name, Clib::ConfigElem &elem)
NpcTemplateConfigSource _source
Definition: npctmpl.h:86
const NpcTemplate & find_npc_template(const Clib::ConfigElem &elem)
Definition: npctmpl.cpp:154
Items::UArmor * intrinsic_shield
Definition: npctmpl.h:40
Clib::ConfigElem _elem
Definition: npctmpl.h:87
Items::UWeapon * intrinsic_weapon
Definition: npctmpl.h:39
ExportScript * method_script
Definition: npctmpl.h:51
std::string name
Definition: npctmpl.h:37
Definition: berror.cpp:12