~widelands-dev/widelands/trunk

6891.1.1 by Shevonar
Moved classes from wlapplication.cc to own files.
1
/*
11165 by The Widelands Bunnybot
Update copyright end year to 2025
2
 * Copyright (C) 2015-2025 by the Widelands Development Team
6891.1.1 by Shevonar
Moved classes from wlapplication.cc to own files.
3
 *
4
 * This program is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU General Public License
6
 * as published by the Free Software Foundation; either version 2
7
 * of the License, or (at your option) any later version.
8
 *
9
 * This program 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
10152 by The Widelands Bunnybot
Add check for missing copyright headers (#5223)
15
 * along with this program; if not, see <https://www.gnu.org/licenses/>.
6891.1.1 by Shevonar
Moved classes from wlapplication.cc to own files.
16
 *
17
 */
18
7054 by Holger Rapp
Unifiy the style of the include guards and add a style rule to keep it that way.
19
#ifndef WL_LOGIC_REPLAY_GAME_CONTROLLER_H
20
#define WL_LOGIC_REPLAY_GAME_CONTROLLER_H
6891.1.1 by Shevonar
Moved classes from wlapplication.cc to own files.
21
6968 by Hans Joachim Desserud
Include memory as suggested by SirVer to fix FTBFS. (LP: #1318315)
22
#include <memory>
23
11186 by The Widelands Bunnybot
Split PlayerCommand into smaller files (CB #4786 / GH #6424)
24
#include "commands/command.h"
7044 by Holger Rapp
Move more stuff out of the base directory.
25
#include "logic/game_controller.h"
6891.1.2 by Shevonar
Got rid of abbreviations.
26
27
namespace Widelands {
8048 by GunChleoc
Ran clang-format.
28
class ReplayReader;
10462 by The Widelands Bunnybot
Clear clang-tidy in logic headers (#5691)
29
}  // namespace Widelands
6891.1.1 by Shevonar
Moved classes from wlapplication.cc to own files.
30
31
class ReplayGameController : public GameController {
32
public:
10409 by The Widelands Bunnybot
Allow loading another replay in replay mode (#5611)
33
	explicit ReplayGameController(Widelands::Game& game);
6891.1.2 by Shevonar
Got rid of abbreviations.
34
35
	void think() override;
36
10191 by The Widelands Bunnybot
Fix misc clang-tidy checks in `logic` (#5255)
37
	void send_player_command(Widelands::PlayerCommand* command) override;
9586 by The Widelands Bunnybot
Make `Time` and `Duration` typesafe (#4325)
38
	Duration get_frametime() override;
7159.2.16 by fios at foramnagaidhlig
Merged trunk
39
	GameController::GameType get_game_type() override;
7181.2.4 by fios at foramnagaidhlig
Fixed function names in anonymous namespace
40
	uint32_t real_speed() override;
41
	uint32_t desired_speed() override;
10462 by The Widelands Bunnybot
Clear clang-tidy in logic headers (#5691)
42
	void set_desired_speed(uint32_t speed) override;
7181.2.4 by fios at foramnagaidhlig
Fixed function names in anonymous namespace
43
	bool is_paused() override;
10462 by The Widelands Bunnybot
Clear clang-tidy in logic headers (#5691)
44
	void set_paused(bool paused) override;
10437 by The Widelands Bunnybot
Make diplomacy window available to spectators (#5609)
45
	void
46
	report_result(uint8_t p_nr, Widelands::PlayerEndResult result, const std::string& info) override;
10473 by The Widelands Bunnybot
Replays: Single-File, Optional Writing, Autodeleting (#5645)
47
	void set_write_replay(bool /* replay */) override {
48
		NEVER_HERE();
49
	}
6891.1.2 by Shevonar
Got rid of abbreviations.
50
51
private:
8048 by GunChleoc
Ran clang-format.
52
	Widelands::Game& game_;
7837.1.1 by fios at foramnagaidhlig
Refactored some member variables in src/logic.
53
	std::unique_ptr<Widelands::ReplayReader> replayreader_;
54
	int32_t lastframe_;
9586 by The Widelands Bunnybot
Make `Time` and `Duration` typesafe (#4325)
55
	Time time_;
10462 by The Widelands Bunnybot
Clear clang-tidy in logic headers (#5691)
56
	uint32_t speed_{1000};
57
	bool paused_{false};
6891.1.1 by Shevonar
Moved classes from wlapplication.cc to own files.
58
};
59
7054 by Holger Rapp
Unifiy the style of the include guards and add a style rule to keep it that way.
60
#endif  // end of include guard: WL_LOGIC_REPLAY_GAME_CONTROLLER_H