ScummVM API documentation
script.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_H
23
#define PHOENIXVR_SCRIPT_H
24
25
#include "common/hash-str.h"
26
#include "common/hashmap.h"
27
#include "common/ptr.h"
28
#include "common/str.h"
29
#include "phoenixvr/commands.h"
30
31
namespace
Common
{
32
class
SeekableReadStream;
33
}
34
35
namespace
PhoenixVR {
36
class
Parser;
37
class
Script
{
38
public
:
39
struct
Test
{
40
int
idx;
41
int
hover;
42
Scope
scope;
43
ScopePtr
enter;
44
ScopePtr
leave;
45
};
46
using
TestPtr
=
Common::SharedPtr<Test>
;
47
48
struct
Warp
{
49
Common::String
vrFile;
50
Common::String
testFile;
51
Common::Array<TestPtr>
tests;
52
53
void
parseLine(
const
Common::String
&line, uint lineno);
54
TestPtr
getTest(
int
idx)
const
;
55
TestPtr
getLastTest(
int
idx)
const
;
56
TestPtr
getDefaultTest()
const
{
57
return
getTest(-1);
58
}
59
};
60
61
using
WarpPtr
=
Common::SharedPtr<Warp>
;
62
using
ConstWarpPtr
=
Common::SharedPtr<const Warp>
;
63
64
protected
:
65
Common::HashMap<Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>
_warpsIndex;
66
Common::Array<Common::String>
_warpNames;
67
Common::Array<WarpPtr>
_warps;
68
struct
VariableDeclaration
{
69
Common::String
name;
70
int
value;
71
};
72
Common::Array<VariableDeclaration>
_vars;
73
74
virtual
void
parseLine(
const
Common::String
&line, uint lineno) = 0;
75
76
public
:
77
Script
();
78
virtual
~Script
();
79
80
static
Script
*load(
Common::SeekableReadStream
&s,
int
version);
81
82
int
getWarp(
const
Common::String
&name)
const
;
83
ConstWarpPtr
getWarp(
int
index)
const
;
84
ConstWarpPtr
getInitScript()
const
;
85
86
uint numWarps()
const
{
87
return
_warps.
size
();
88
}
89
90
const
Common::Array<Common::String>
&getWarpNames()
const
{
91
return
_warpNames;
92
}
93
const
Common::Array<VariableDeclaration>
&getVars()
const
{
94
return
_vars;
95
}
96
};
97
}
// namespace PhoenixVR
98
99
#endif
Common::Array
Definition:
array.h:52
Common::Array::size
size_type size() const
Definition:
array.h:316
Common::HashMap< Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo >
Common::SeekableReadStream
Definition:
stream.h:745
Common::SharedPtr< Scope >
Common::String
Definition:
str.h:59
PhoenixVR::Script
Definition:
script.h:37
Common
Definition:
algorithm.h:29
PhoenixVR::Scope
Definition:
commands.h:48
PhoenixVR::Script::Test
Definition:
script.h:39
PhoenixVR::Script::VariableDeclaration
Definition:
script.h:68
PhoenixVR::Script::Warp
Definition:
script.h:48
engines
phoenixvr
script.h
Generated on Sat Oct 24 2026 09:27:28 for ScummVM API documentation by
1.9.4