ScummVM API documentation
m_swap.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 QDENGINE_MINIGAMES_ADV_M_SWAP_H
23
#define QDENGINE_MINIGAMES_ADV_M_SWAP_H
24
25
#include "qdengine/minigames/adv/MinigameInterface.h"
26
27
namespace
QDEngine
{
28
29
class
Swap
:
public
MinigameInterface
{
30
public
:
31
Swap
();
32
~
Swap
();
33
34
void
quant(
float
dt);
35
private
:
36
int
gameSize_;
37
int
angles_;
38
39
float
rotateTimePeriod_;
40
float
nextRotateTime_;
41
42
mgVect2f
size_;
43
44
struct
Node {
45
Node(
int
idx = -1) : home(idx), angle(0) {}
46
QDObject
obj;
47
int
angle;
48
int
home;
49
};
50
typedef
vector<Node>
Nodes
;
51
Nodes nodes_;
52
53
// Индекс фрагмента на мыши
54
int
pickedItem_;
55
// активные фрагменты после обмена
56
int
last1_, last2_;
57
58
Coords
positions_;
59
60
const
char
*getStateName(
int
angle,
bool
selected)
const
;
61
// поменять местами, если было снятие или укладка на/с правильного места, то true
62
void
swap(
int
item1,
int
item2,
bool
silent);
63
// повернуть фишку
64
void
rotate(
int
item1,
int
item2,
bool
silent,
bool
avto =
false
);
65
// погасить выделенные
66
void
deactivate();
67
// проверить нахождение фишки на своем месте
68
bool
testPlace(
int
idx)
const
;
69
// поставить объект на свое место и включить нужное состояние
70
void
put(
int
idx,
bool
hl);
71
// мировые координаты слота на поле
72
const
mgVect3f
&position(
int
num)
const
;
73
74
};
75
76
}
// namespace QDEngine
77
78
#endif // QDENGINE_MINIGAMES_ADV_M_SWAP_H
Std::vector< Node >
QDEngine::QDObject
Definition:
common.h:34
QDEngine::MinigameInterface
Definition:
MinigameInterface.h:27
QDEngine::mgVect3< float >
QDEngine::mgVect2< float >
QDEngine
Базовый класс для игровых ресурсов.
Definition:
console.h:28
QDEngine::Swap
Definition:
m_swap.h:29
engines
qdengine
minigames
adv
m_swap.h
Generated on Thu Nov 21 2024 09:18:05 for ScummVM API documentation by
1.8.13