Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
ICmpCinemaManager.h
Go to the documentation of this file.
1/* Copyright (C) 2026 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef INCLUDED_ICMPCINEMAMANAGER
19#define INCLUDED_ICMPCINEMAMANAGER
20
21
24
25#include <js/Value.h>
26#include <list>
27#include <map>
28
29class CCamera;
30class CCinemaPath;
31class CStrW;
32
33/**
34 * Manages a dynamic list of cinema paths (predefined camera movements/cutscenes) as well as a queue of paths that
35 * is played one by one on command to all players. Simulation messages are sent each time a path ends and also when
36 * the queue finishes as a whole.
37 */
39{
40public:
41 /**
42 * Register a new path.
43 * @param path path data
44 */
45 virtual void AddPath(const CCinemaPath& path) = 0;
46
47 /**
48 * Remove a path and its data entirely.
49 * @param name path name
50 */
51 virtual void DeletePath(const CStrW& name) = 0;
52
53 /**
54 * Check whether a path exists (is registered under the given name)..
55 * @param name path name
56 */
57 virtual bool HasPath(const CStrW& name) const = 0;
58
59 /**
60 * Get all registered paths, keyed by their names.
61 */
62 virtual const std::map<CStrW, CCinemaPath>& GetPaths() const = 0;
63
64 /**
65 * Override the entire list of existing paths.
66 * @param newPaths new list of paths
67 */
68 virtual void SetPaths(const std::map<CStrW, CCinemaPath>& newPaths) = 0;
69
70 /**
71 * Push a path to the back of the queue.
72 * @param name path name
73 */
74 virtual void PushPathToQueue(const CStrW& name) = 0;
75
76 /**
77 * Clear all paths from the queue.
78 */
79 virtual void ClearQueue() = 0;
80
81 /**
82 * Start playing the paths in the queue one by one.
83 */
84 virtual void StartPlayingQueue() = 0;
85
86 /**
87 * Stop playing the active path and the queue altogether.
88 */
89 virtual void StopPlayingQueue() = 0;
90
91 /**
92 * Whether the first path of the queue is being played at the moment.
93 */
94 virtual bool IsPlayingQueue() const = 0;
95
96 /**
97 * Send an update to the path currently playing for it to determine the new camera position.
98 * Called every frame.
99 */
100 virtual void UpdateActivePath(const float deltaRealTime, CCamera& camera) = 0;
101
102 /**
103 * Get the name of the path currently playing, if any.
104 */
105 virtual CStrW GetActivePath() const = 0;
106
107 /**
108 * Get the time elapsed since the currently active path started playing.
109 */
110 virtual fixed GetActivePathElapsedTime() const = 0;
111
112 DECLARE_INTERFACE_TYPE(CinemaManager)
113};
114
115#endif // INCLUDED_ICMPCINEMAMANAGER
Definition: Camera.h:46
Definition: CinemaPath.h:61
A simple fixed-point number class.
Definition: Fixed.h:129
Manages a dynamic list of cinema paths (predefined camera movements/cutscenes) as well as a queue of ...
Definition: ICmpCinemaManager.h:39
virtual void SetPaths(const std::map< CStrW, CCinemaPath > &newPaths)=0
Override the entire list of existing paths.
virtual bool IsPlayingQueue() const =0
Whether the first path of the queue is being played at the moment.
virtual void PushPathToQueue(const CStrW &name)=0
Push a path to the back of the queue.
virtual void ClearQueue()=0
Clear all paths from the queue.
virtual void StopPlayingQueue()=0
Stop playing the active path and the queue altogether.
virtual const std::map< CStrW, CCinemaPath > & GetPaths() const =0
Get all registered paths, keyed by their names.
virtual void StartPlayingQueue()=0
Start playing the paths in the queue one by one.
virtual void DeletePath(const CStrW &name)=0
Remove a path and its data entirely.
virtual bool HasPath(const CStrW &name) const =0
Check whether a path exists (is registered under the given name).
virtual CStrW GetActivePath() const =0
Get the name of the path currently playing, if any.
virtual void UpdateActivePath(const float deltaRealTime, CCamera &camera)=0
Send an update to the path currently playing for it to determine the new camera position.
virtual void AddPath(const CCinemaPath &path)=0
Register a new path.
virtual fixed GetActivePathElapsedTime() const =0
Get the time elapsed since the currently active path started playing.
Definition: IComponent.h:33
#define DECLARE_INTERFACE_TYPE(iname)
Definition: Interface.h:23