~ubuntu-branches/ubuntu/trusty/lordsawar/trusty

« back to all changes in this revision

Viewing changes to src/CreateScenarioRandomize.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2008-06-17 16:07:00 UTC
  • mto: (5.1.1 lenny) (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20080617160700-6d8ofoz0qkasxlnw
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Copyright (C) 2008, Ben Asselstine
 
2
//
 
3
//  This program is free software; you can redistribute it and/or modify
 
4
//  it under the terms of the GNU General Public License as published by
 
5
//  the Free Software Foundation; either version 2 of the License, or
 
6
//  (at your option) any later version.
 
7
//
 
8
//  This program is distributed in the hope that it will be useful,
 
9
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
//  GNU Library General Public License for more details.
 
12
//
 
13
//  You should have received a copy of the GNU General Public License
 
14
//  along with this program; if not, write to the Free Software
 
15
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
 
16
//  02110-1301, USA.
 
17
 
 
18
#ifndef CREATE_SCENARIO_RANDOMIZE_H
 
19
#define CREATE_SCENARIO_RANDOMIZE_H
 
20
 
 
21
#include <fstream>
 
22
#include <string>
 
23
#include <vector>
 
24
#include <SDL.h>
 
25
#include "game-parameters.h"
 
26
 
 
27
class Signpost;
 
28
class Army;
 
29
class Player;
 
30
class Reward;
 
31
 
 
32
class CreateScenarioRandomize
 
33
{
 
34
    public:
 
35
        CreateScenarioRandomize();
 
36
        ~CreateScenarioRandomize();
 
37
 
 
38
        /** take a random city name
 
39
         */
 
40
        std::string popRandomCityName();
 
41
 
 
42
        /* give a random city name
 
43
         */
 
44
        void pushRandomCityName(std::string name);
 
45
        std::string popRandomRuinName();
 
46
        void pushRandomRuinName(std::string name);
 
47
        std::string popRandomTempleName();
 
48
        void pushRandomTempleName(std::string name);
 
49
        std::string popRandomSignpost();
 
50
        void pushRandomSignpost(std::string name);
 
51
        Uint32 getRandomCityIncome(bool capital = false);
 
52
        bool randomSignpostsEmpty() {return d_signposts.empty();}
 
53
        std::string getDynamicSignpost(Signpost *signpost);
 
54
        int getNumSignposts() {return d_signposts.size();}
 
55
        Army * getRandomRuinKeeper(Player *p);
 
56
        Reward *getNewRandomReward(bool hidden_ruins);
 
57
 
 
58
    private:
 
59
 
 
60
        std::string popRandomListName(std::vector<std::string>& list);
 
61
 
 
62
        bool loadNames(std::vector<std::string>& list, std::ifstream& file);
 
63
 
 
64
        //the namelists
 
65
        std::vector<std::string> d_citynames, d_signposts;
 
66
        std::vector<std::string> d_templenames, d_ruinnames;
 
67
};
 
68
 
 
69
#endif  //CREATE_SCENARIO_RANDOMIZE_H