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
(
MinigameManager
*runtime);
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
Std::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
MinigameManager
*_runtime;
75
};
76
77
}
// namespace QDEngine
78
79
#endif // QDENGINE_MINIGAMES_ADV_M_SWAP_H
Std::vector< Node >
QDEngine::QDObject
Definition:
common.h:34
QDEngine::MinigameInterface
Definition:
MinigameInterface.h:27
QDEngine::MinigameManager
Definition:
RunTime.h:94
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 Sun Dec 22 2024 09:17:43 for ScummVM API documentation by
1.8.13