OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
base.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_NIF_BASE_HPP
3 #define OPENMW_COMPONENTS_NIF_BASE_HPP
4 
5 #include "record.hpp"
6 #include "niffile.hpp"
7 #include "recordptr.hpp"
8 #include "nifstream.hpp"
9 #include "nifkey.hpp"
10 
11 namespace Nif
12 {
17 class Extra : public Record
18 {
19 public:
21 
22  void read(NIFStream *nif) { extra.read(nif); }
23  void post(NIFFile *nif) { extra.post(nif); }
24 };
25 
26 class Controller : public Record
27 {
28 public:
30  int flags;
31  float frequency, phase;
34 
35  void read(NIFStream *nif);
36  void post(NIFFile *nif);
37 };
38 
40 class Controlled : public Extra
41 {
42 public:
44 
45  void read(NIFStream *nif)
46  {
47  Extra::read(nif);
48  controller.read(nif);
49  }
50 
51  void post(NIFFile *nif)
52  {
53  Extra::post(nif);
54  controller.post(nif);
55  }
56 };
57 
59 class Named : public Controlled
60 {
61 public:
62  std::string name;
63 
64  void read(NIFStream *nif)
65  {
66  name = nif->getString();
67  Controlled::read(nif);
68  }
69 };
71 
72 } // Namespace
73 #endif
float phase
Definition: base.hpp:31
Definition: niffile.hpp:17
std::string getString(size_t length)
Read in a string of the given length.
Definition: nifstream.cpp:86
float timeStop
Definition: base.hpp:32
Anything that has a controller.
Definition: base.hpp:40
Base class for all records.
Definition: record.hpp:100
void read(NIFStream *nif)
Parses the record from file.
Definition: base.hpp:64
float frequency
Definition: base.hpp:31
std::string name
Definition: base.hpp:62
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:23
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: base.hpp:51
Has name, extra-data and controller.
Definition: base.hpp:59
int flags
Definition: base.hpp:30
void post(NIFFile *nif)
Resolve index to pointer.
Definition: recordptr.hpp:38
void read(NIFStream *nif)
Parses the record from file.
Definition: base.hpp:22
void read(NIFStream *nif)
Read the index from the nif.
Definition: recordptr.hpp:27
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:9
ControllerPtr controller
Definition: base.hpp:43
Definition: base.hpp:26
ControllerPtr next
Definition: base.hpp:29
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: base.hpp:23
float timeStart
Definition: base.hpp:32
Named NiSequenceStreamHelper
Definition: base.hpp:70
Definition: nifstream.hpp:26
ExtraPtr extra
Definition: base.hpp:20
ControlledPtr target
Definition: base.hpp:33
Definition: base.hpp:17
void read(NIFStream *nif)
Parses the record from file.
Definition: base.hpp:45