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
};
44
inline
PauseType
& operator|=(
PauseType
& a,
const
PauseType
& b)
45
{
46
return
a =
static_cast<
PauseType
>
(
static_cast<
unsigned
int
>
(a) | static_cast<unsigned int>(b));
47
}
48
inline
PauseType
operator|(
PauseType
a,
const
PauseType
& b)
49
{
50
return
a |= b;
51
}
52
inline
PauseType
& operator&=(
PauseType
& a,
const
PauseType
& b)
53
{
54
return
a =
static_cast<
PauseType
>
(
static_cast<
unsigned
int
>
(a) & static_cast<unsigned int>(b));
55
}
56
inline
PauseType
operator&(
PauseType
a,
const
PauseType
& b)
57
{
58
return
a &= b;
59
}
60
61
enum
PauseMusic
62
{
63
PAUSE_MUSIC_NONE = 0,
64
PAUSE_MUSIC_EDITOR = 1,
65
PAUSE_MUSIC_SATCOM = 2,
66
};
67
68
struct
ActivePause
;
69
70
class
CPauseManager
71
{
72
public
:
73
CPauseManager
();
74
~
CPauseManager
();
75
76
ActivePause
* ActivatePause(
PauseType
type, PauseMusic music = PAUSE_MUSIC_NONE);
77
void
DeactivatePause(
ActivePause
* pause);
78
79
void
FlushPause();
80
81
PauseType
GetPause();
82
bool
IsPauseType(
PauseType
type);
83
84
private
:
85
//static std::string GetPauseName(PauseType pause);
86
void
Update();
87
88
private
:
89
CRobotMain
* m_main;
90
91
std::vector<std::unique_ptr<ActivePause>> m_activePause;
92
PauseMusic m_lastPauseMusic = PAUSE_MUSIC_NONE;
93
};
ActivePause
Definition:
pausemanager.cpp:30
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:152
PAUSE_ENGINE
pause all the CEngine classes
Definition:
pausemanager.h:38
PAUSE_MUTE_SOUND
mute sound
Definition:
pausemanager.h:42
CPauseManager
Definition:
pausemanager.h:70
PAUSE_HIDE_SHORTCUTS
hide the shortcuts
Definition:
pausemanager.h:39
Generated by
1.8.11