Colobot
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
app
pausemanager.h
Go to the documentation of this file.
1
/*
2
* This file is part of the Colobot: Gold Edition source code
3
* Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
4
* http://epsitec.ch; http://colobot.info; http://github.com/colobot
5
*
6
* This program is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
* See the GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see http://gnu.org/licenses
18
*/
19
24
#pragma once
25
26
#include "common/make_unique.h"
27
28
#include <string>
29
#include <vector>
30
#include <memory>
31
32
class
CRobotMain
;
33
34
35
enum
PauseType
36
{
37
PAUSE_NONE = 0,
38
PAUSE_ENGINE
= (1<<0),
39
PAUSE_HIDE_SHORTCUTS
= (1<<1),
40
PAUSE_PHOTO
= (1<<2),
41
PAUSE_OBJECT_UPDATES
= (1<<3),
42
PAUSE_MUTE_SOUND
= (1<<4),
43
PAUSE_CAMERA
= (1<<5),
44
};
45
inline
PauseType
& operator|=(
PauseType
& a,
const
PauseType
& b)
46
{
47
return
a =
static_cast<
PauseType
>
(
static_cast<
unsigned
int
>
(a) | static_cast<unsigned int>(b));
48
}
49
inline
PauseType
operator|(
PauseType
a,
const
PauseType
& b)
50
{
51
return
a |= b;
52
}
53
inline
PauseType
& operator&=(
PauseType
& a,
const
PauseType
& b)
54
{
55
return
a =
static_cast<
PauseType
>
(
static_cast<
unsigned
int
>
(a) & static_cast<unsigned int>(b));
56
}
57
inline
PauseType
operator&(
PauseType
a,
const
PauseType
& b)
58
{
59
return
a &= b;
60
}
61
62
enum
PauseMusic
63
{
64
PAUSE_MUSIC_NONE = 0,
65
PAUSE_MUSIC_EDITOR = 1,
66
PAUSE_MUSIC_SATCOM = 2,
67
};
68
69
struct
ActivePause
;
70
71
class
CPauseManager
72
{
73
public
:
74
CPauseManager
();
75
~
CPauseManager
();
76
77
ActivePause
* ActivatePause(
PauseType
type, PauseMusic music = PAUSE_MUSIC_NONE);
78
void
DeactivatePause(
ActivePause
* pause);
79
80
void
FlushPause();
81
82
PauseType
GetPause();
83
bool
IsPauseType(
PauseType
type);
84
85
private
:
86
//static std::string GetPauseName(PauseType pause);
87
void
Update();
88
89
private
:
90
CRobotMain
* m_main;
91
92
std::vector<std::unique_ptr<ActivePause>> m_activePause;
93
PauseMusic m_lastPauseMusic = PAUSE_MUSIC_NONE;
94
};
ActivePause
Definition:
pausemanager.cpp:31
PAUSE_OBJECT_UPDATES
do not send events to objects
Definition:
pausemanager.h:41
PauseType
PauseType
Definition:
pausemanager.h:35
PAUSE_PHOTO
photo mode, TODO: remove
Definition:
pausemanager.h:40
CRobotMain
Definition:
robotmain.h:159
PAUSE_ENGINE
pause all the CEngine classes
Definition:
pausemanager.h:38
PAUSE_MUTE_SOUND
mute sound
Definition:
pausemanager.h:42
CPauseManager
Definition:
pausemanager.h:71
PAUSE_CAMERA
freeze camera
Definition:
pausemanager.h:43
PAUSE_HIDE_SHORTCUTS
hide the shortcuts
Definition:
pausemanager.h:39
Generated by
1.8.11