]> git.jsancho.org Git - lugaru.git/blob - Source/Level/Campaign.hpp
clang-format: Apply to all headers
[lugaru.git] / Source / Level / Campaign.hpp
1 /*
2 Copyright (C) 2003, 2010 - Wolfire Games
3 Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file)
4
5 This file is part of Lugaru.
6
7 Lugaru 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 2 of the License, or
10 (at your option) any later version.
11
12 Lugaru 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 Lugaru.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "Math/XYZ.hpp"
22
23 #include <string>
24 #include <vector>
25
26 extern bool campaign;
27
28 extern int actuallevel;
29 extern std::string campaignEndText[3];
30
31 std::vector<std::string> ListCampaigns();
32 void LoadCampaign();
33
34 class CampaignLevel
35 {
36 private:
37     int width;
38     struct Position
39     {
40         int x, y;
41     };
42
43 public:
44     std::string mapname;
45     std::string description;
46     int choosenext;
47     /*
48     0 = Immediately load next level at the end of this one.
49     1 = Go back to the world map.
50     2 = Don't bring up the Fiery loading screen. Maybe other things, I've not investigated.
51     */
52     //int numnext; // 0 on final level. As David said: he meant to add story branching, but he eventually hadn't.
53     std::vector<int> nextlevel;
54     Position location;
55     CampaignLevel();
56     int getStartX();
57     int getStartY();
58     int getEndX();
59     int getEndY();
60     XYZ getCenter();
61     int getWidth();
62     std::istream& operator<<(std::istream& is);
63     friend std::istream& operator>>(std::istream& is, CampaignLevel& cl)
64     {
65         return cl << is;
66     }
67 };
68
69 extern std::vector<CampaignLevel> campaignlevels;