File: context.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 (96 lines) | stat: -rw-r--r-- 2,981 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef INTERPRETER_CONTEXT_H_INCLUDED
#define INTERPRETER_CONTEXT_H_INCLUDED

#include <components/esm/refid.hpp>
#include <string>
#include <string_view>
#include <vector>

namespace Interpreter
{
    class Context
    {
    public:
        virtual ~Context() {}

        virtual ESM::RefId getTarget() const = 0;

        virtual int getLocalShort(int index) const = 0;

        virtual int getLocalLong(int index) const = 0;

        virtual float getLocalFloat(int index) const = 0;

        virtual void setLocalShort(int index, int value) = 0;

        virtual void setLocalLong(int index, int value) = 0;

        virtual void setLocalFloat(int index, float value) = 0;

        virtual void messageBox(std::string_view message, const std::vector<std::string>& buttons) = 0;

        void messageBox(std::string_view message)
        {
            std::vector<std::string> empty;
            messageBox(message, empty);
        }

        virtual void report(const std::string& message) = 0;

        virtual int getGlobalShort(std::string_view name) const = 0;

        virtual int getGlobalLong(std::string_view name) const = 0;

        virtual float getGlobalFloat(std::string_view name) const = 0;

        virtual void setGlobalShort(std::string_view name, int value) = 0;

        virtual void setGlobalLong(std::string_view name, int value) = 0;

        virtual void setGlobalFloat(std::string_view name, float value) = 0;

        virtual std::vector<std::string> getGlobals() const = 0;

        virtual char getGlobalType(std::string_view name) const = 0;

        virtual std::string getActionBinding(std::string_view action) const = 0;

        virtual std::string_view getActorName() const = 0;

        virtual std::string_view getNPCRace() const = 0;

        virtual std::string_view getNPCClass() const = 0;

        virtual std::string_view getNPCFaction() const = 0;

        virtual std::string_view getNPCRank() const = 0;

        virtual std::string_view getPCName() const = 0;

        virtual std::string_view getPCRace() const = 0;

        virtual std::string_view getPCClass() const = 0;

        virtual std::string_view getPCRank() const = 0;

        virtual std::string_view getPCNextRank() const = 0;

        virtual int getPCBounty() const = 0;

        virtual std::string_view getCurrentCellName() const = 0;

        virtual int getMemberShort(ESM::RefId id, std::string_view name, bool global) const = 0;

        virtual int getMemberLong(ESM::RefId id, std::string_view name, bool global) const = 0;

        virtual float getMemberFloat(ESM::RefId id, std::string_view name, bool global) const = 0;

        virtual void setMemberShort(ESM::RefId id, std::string_view name, int value, bool global) = 0;

        virtual void setMemberLong(ESM::RefId id, std::string_view name, int value, bool global) = 0;

        virtual void setMemberFloat(ESM::RefId id, std::string_view name, float value, bool global) = 0;
    };
}

#endif