mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-23 22:40:25 +00:00

[[The Wesnoth repository started off as CVS in September 2003 on SourceForge. In September 2005 it was converted to Subversion using cvs2svn and hosted at Gna!; the last CVS commit corresponded to Subversion r8374. In March 2013 it was converted to git by ESR using reposurgeon 2.30; the last Subversion commit was r56594. In the process, several small, abandoned experimental branches were removed. For all branches known to have been merged to trunk merge points were found and patched in. Comments have been massaged into git summary + body form; revision references have been lifted to action stamps. Conversion comments are, like this one, enclosed in double square brackets. Typos in change comments have often been quietly fixed. Some abbreviations (notably for mainline campaign names) have been made more uniform than they were in the Subversion comments. Infix "::" to mark a campaign-scenario pair (as in "HttT::12" has sometimes been inserted for clarity and to shorten summary lines. Two branches, website/ and resources/, have been merged to trunk, where their history now appears as that of those two top-level directories rather than as separate branches. Subversion property settings, and the commits in the Subversion history that manipulated them, are almost all gone. A few have been translated to .gitignore files and setting of executable bits. There are a few committers that we have been unable to identify. These are: uso zas uid65860 uid66289 uid67456 uid68698 uid68803 uid68842 uid68850 uid68852 uid69097 uid69206 The uid names seem to have been mechanically generated from Wesnoth forum postings. Committer lines for all of these have been left without a domain name in the email address.]]
81 lines
1.7 KiB
C++
81 lines
1.7 KiB
C++
/*
|
|
Copyright (C) 2003 by David White <davidnwhite@optusnet.com.au>
|
|
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License.
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY.
|
|
|
|
See the COPYING file for more details.
|
|
*/
|
|
#ifndef TEAM_H_INCLUDED
|
|
#define TEAM_H_INCLUDED
|
|
|
|
#include "config.hpp"
|
|
#include "map.hpp"
|
|
|
|
#include <cassert>
|
|
#include <set>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class team
|
|
{
|
|
public:
|
|
|
|
struct target {
|
|
explicit target(config& cfg);
|
|
config criteria;
|
|
double value;
|
|
};
|
|
|
|
struct team_info
|
|
{
|
|
team_info(config& cfg);
|
|
std::string name;
|
|
std::string gold;
|
|
std::set<std::string> can_recruit;
|
|
std::vector<std::string> recruitment_pattern;
|
|
double aggression;
|
|
std::vector<int> enemies;
|
|
bool human;
|
|
|
|
double leader_value, village_value;
|
|
|
|
std::vector<target> targets;
|
|
};
|
|
|
|
team(config& cfg, int gold=100);
|
|
void get_tower(const gamemap::location&);
|
|
void lose_tower(const gamemap::location&);
|
|
int towers() const;
|
|
bool owns_tower(const gamemap::location&) const;
|
|
|
|
int gold() const;
|
|
int income() const;
|
|
void new_turn();
|
|
void spend_gold(int amount);
|
|
|
|
const std::set<std::string>& recruits() const;
|
|
const std::vector<std::string>& recruitment_pattern() const;
|
|
const std::string& name() const;
|
|
|
|
bool is_enemy(int side) const;
|
|
double aggression() const;
|
|
|
|
bool is_human() const;
|
|
|
|
double leader_value() const;
|
|
double village_value() const;
|
|
|
|
std::vector<target>& targets();
|
|
private:
|
|
int gold_;
|
|
std::set<gamemap::location> towers_;
|
|
|
|
team_info info_;
|
|
};
|
|
|
|
#endif
|