File: fallback.hpp

package info (click to toggle)
openmw 0.49.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,992 kB
  • sloc: cpp: 372,479; xml: 2,149; sh: 1,403; python: 797; makefile: 26
file content (36 lines) | stat: -rw-r--r-- 1,278 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef OPENMW_COMPONENTS_FALLBACK_H
#define OPENMW_COMPONENTS_FALLBACK_H

#include <map>
#include <string>
#include <string_view>

#include <osg/Vec4f>

namespace Fallback
{
    /// @brief contains settings imported from the Morrowind INI file.
    class Map
    {
        static std::map<std::string, int, std::less<>> mIntFallbackMap;
        static std::map<std::string, float, std::less<>> mFloatFallbackMap;
        static std::map<std::string, std::string, std::less<>> mNonNumericFallbackMap;

    public:
        static void init(const std::map<std::string, std::string>& fallback);

        static const std::map<std::string, int, std::less<>>& getIntFallbackMap() { return mIntFallbackMap; }
        static const std::map<std::string, float, std::less<>>& getFloatFallbackMap() { return mFloatFallbackMap; }
        static const std::map<std::string, std::string, std::less<>>& getNonNumericFallbackMap()
        {
            return mNonNumericFallbackMap;
        }

        static std::string_view getString(std::string_view fall);
        static float getFloat(std::string_view fall);
        static int getInt(std::string_view fall);
        static bool getBool(std::string_view fall);
        static osg::Vec4f getColour(std::string_view fall);
    };
}
#endif