1 /** @file decoration.h  Decoration definition accessor.
2  *
3  * @authors Copyright © 2015 Daniel Swanson <danij@dengine.net>
4  *
5  * @par License
6  * GPL: http://www.gnu.org/licenses/gpl.html
7  *
8  * <small>This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by the
10  * Free Software Foundation; either version 2 of the License, or (at your
11  * option) any later version. This program is distributed in the hope that it
12  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14  * Public License for more details. You should have received a copy of the GNU
15  * General Public License along with this program; if not, see:
16  * http://www.gnu.org/licenses</small>
17  */
18 
19 #ifndef LIBDOOMSDAY_DEFN_DECORATION_H
20 #define LIBDOOMSDAY_DEFN_DECORATION_H
21 
22 #include "definition.h"
23 #include <de/RecordAccessor>
24 
25 // Flags for decoration definitions.
26 #define DCRF_NO_IWAD   0x1  ///< Don't use if from IWAD.
27 #define DCRF_PWAD      0x2  ///< Can use if from PWAD.
28 //#define DCRF_EXTERNAL  0x4  ///< Can use if from external resource.
29 
30 namespace defn {
31 
32 /**
33  * Utility for handling oldschool decoration definitions.
34  */
35 class LIBDOOMSDAY_PUBLIC Decoration : public Definition
36 {
37 public:
Decoration()38     Decoration()                        : Definition() {}
Decoration(Decoration const & other)39     Decoration(Decoration const &other) : Definition(other) {}
Decoration(de::Record & d)40     Decoration(de::Record &d)           : Definition(d) {}
Decoration(de::Record const & d)41     Decoration(de::Record const &d)     : Definition(d) {}
42 
43     void resetToDefaults();
44 
45     int lightCount() const;
46     bool hasLight(int index) const;
47 
48     de::Record       &light(int index);
49     de::Record const &light(int index) const;
50 
51     de::Record &addLight();
52 };
53 
54 }  // namespace defn
55 
56 #endif  // LIBDOOMSDAY_DEFN_DECORATION_H
57