]> git.jsancho.org Git - lugaru.git/blob - Source/Level/Campaign.hpp
77eb313aa11eb1c32307c2127410f139faac81b2
[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
30 std::vector<std::string> ListCampaigns();
31 void LoadCampaign();
32
33 class CampaignLevel
34 {
35 private:
36     int width;
37     struct Position {
38         int x, y;
39     };
40 public:
41     std::string mapname;
42     std::string description;
43     int choosenext;
44     /*
45     0 = Immediately load next level at the end of this one.
46     1 = Go back to the world map.
47     2 = Don't bring up the Fiery loading screen. Maybe other things, I've not investigated.
48     */
49     //int numnext; // 0 on final level. As David said: he meant to add story branching, but he eventually hadn't.
50     std::vector<int> nextlevel;
51     Position location;
52     CampaignLevel();
53     int getStartX();
54     int getStartY();
55     int getEndX();
56     int getEndY();
57     XYZ getCenter();
58     int getWidth();
59     std::istream& operator<< (std::istream& is);
60     friend std::istream& operator>> (std::istream& is, CampaignLevel& cl) {
61         return cl << is;
62     }
63 };
64
65 extern std::vector<CampaignLevel> campaignlevels;