]> git.jsancho.org Git - lugaru.git/blob - Source/Level/Campaign.hpp
Reading the campaign end text from campaign file (see #60)
[lugaru.git] / Source / Level / Campaign.hpp
1 /*
2 Copyright (C) 2003, 2010 - Wolfire Games
3 Copyright (C) 2010-2016 - 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         int x, y;
40     };
41 public:
42     std::string mapname;
43     std::string description;
44     int choosenext;
45     /*
46     0 = Immediately load next level at the end of this one.
47     1 = Go back to the world map.
48     2 = Don't bring up the Fiery loading screen. Maybe other things, I've not investigated.
49     */
50     //int numnext; // 0 on final level. As David said: he meant to add story branching, but he eventually hadn't.
51     std::vector<int> nextlevel;
52     Position location;
53     CampaignLevel();
54     int getStartX();
55     int getStartY();
56     int getEndX();
57     int getEndY();
58     XYZ getCenter();
59     int getWidth();
60     std::istream& operator<< (std::istream& is);
61     friend std::istream& operator>> (std::istream& is, CampaignLevel& cl) {
62         return cl << is;
63     }
64 };
65
66 extern std::vector<CampaignLevel> campaignlevels;