Game Develop Core: Instruction.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Instruction.h
Go to the documentation of this file.
1
5 #ifndef INSTRUCTION_H
6 #define INSTRUCTION_H
7 #include <string>
8 #include <vector>
9 #include "GDCore/Events/Expression.h"
10
11 namespace gd
12 {
13
25 class GD_CORE_API Instruction
26 {
27 public:
28
32 Instruction(std::string type_ = "");
33
37 Instruction(std::string type_, const std::vector <gd::Expression> & parameters_, bool inverted = false);
38
39 virtual ~Instruction();
40
45 std::string GetType() const { return type; }
46
50 void SetType(const std::string & newType) { type = newType; }
51
56 bool IsInverted() const { return inverted; }
57
61 void SetInverted(bool inverted_) { inverted = inverted_; }
62
66 const gd::Expression & GetParameter(unsigned int index) const;
67
71 gd::Expression & GetParameter(unsigned int index);
72
76 inline const std::vector < gd::Expression > & GetParameters() const { return parameters; }
77
81 inline void SetParameters(const std::vector < gd::Expression > & val) { parameters = val; }
82
87 void SetParameter(unsigned int nb, const gd::Expression & val);
88
92 inline const std::vector < Instruction > & GetSubInstructions() const { return subInstructions; };
93
97 inline std::vector < Instruction > & GetSubInstructions() { return subInstructions; };
98
102 inline void SetSubInstructions(const std::vector < Instruction > & subInstructions_) { subInstructions = subInstructions_; };
103
107
109 mutable bool renderedHeightNeedUpdate;
110 mutable unsigned int renderedHeight;
111 mutable bool selected;
112
114
115 private:
116
117 std::string type;
118 bool inverted;
119 mutable std::vector < gd::Expression > parameters;
120 std::vector < Instruction > subInstructions;
121
122 static gd::Expression badExpression;
123 };
124
125 }
126
127 #endif // INSTRUCTION_H
128
129
130
131
132
133
134