ScummVM API documentation
script_v2.h
1
/* ScummVM - Graphic Adventure Engine
2
*
3
* ScummVM is the legal property of its developers, whose names
4
* are too numerous to list here. Please refer to the COPYRIGHT
5
* file distributed with this source distribution.
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*
20
*/
21
22
#ifndef PHOENIXVR_SCRIPT_V2_H
23
#define PHOENIXVR_SCRIPT_V2_H
24
25
#include "phoenixvr/script.h"
26
27
namespace
PhoenixVR {
28
class
ScriptV2
:
public
Script
{
29
public
:
30
struct
Condition
{
31
Common::String
op;
32
Common::String
arg1;
33
Common::String
arg2;
34
35
Condition
(
const
Common::String
&text);
36
bool
parse(
const
Common::String
&text,
const
Common::String
&maybeOp);
37
int
value()
const
;
38
};
39
using
ConditionPtr
=
Common::SharedPtr<Condition>
;
40
41
struct
Conditional
:
public
Command
{
42
Common::Array<ConditionPtr>
conditions;
43
ScopePtr
trueScope;
44
ScopePtr
falseScope;
45
46
Conditional
(
const
Common::Array<Common::String>
&args);
47
void
branch(
ExecutionContext
&ctx,
bool
branch)
const
;
48
};
49
using
ConditionalPtr
=
Common::SharedPtr<Conditional>
;
50
51
private
:
52
WarpPtr
_currentWarp;
53
TestPtr
_currentTest;
54
Scope
*_currentTestScope =
nullptr
;
55
struct
ConditionalScope {
56
ConditionalPtr
conditional;
57
ScopePtr
scope;
58
};
59
Common::Array<ConditionalScope>
_conditionals;
60
61
Scope
&topScope()
const
{
62
assert(_currentTestScope);
63
return
!_conditionals.
empty
() ? *_conditionals.
back
().scope : *_currentTestScope;
64
}
65
void
closeScope();
66
void
closeAllScopes();
67
void
closeAllScopesWithWarning(
int
lineno);
68
69
private
:
70
void
parseLine(
const
Common::String
&line, uint lineno)
override
;
71
};
72
}
// namespace PhoenixVR
73
74
#endif
Common::Array
Definition:
array.h:52
Common::Array::back
T & back()
Definition:
array.h:230
Common::Array::empty
bool empty() const
Definition:
array.h:352
Common::SharedPtr< Condition >
Common::String
Definition:
str.h:59
PhoenixVR::Script
Definition:
script.h:37
PhoenixVR::ScriptV2
Definition:
script_v2.h:28
PhoenixVR::Command
Definition:
commands.h:40
PhoenixVR::ExecutionContext
Definition:
commands.h:33
PhoenixVR::Scope
Definition:
commands.h:48
PhoenixVR::ScriptV2::Condition
Definition:
script_v2.h:30
PhoenixVR::ScriptV2::Conditional
Definition:
script_v2.h:41
engines
phoenixvr
script_v2.h
Generated on Sat Oct 24 2026 09:22:44 for ScummVM API documentation by
1.9.4