File: targets.cpp

package info (click to toggle)
btanks 0.9.8083-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 43,616 kB
  • sloc: cpp: 46,425; ansic: 12,005; xml: 4,262; python: 313; sh: 13; makefile: 13
file content (39 lines) | stat: -rw-r--r-- 1,104 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "targets.h"

using namespace ai;

IMPLEMENT_SINGLETON(ai::Targets, ai::ITargets);

void ITargets::insert(std::set<std::string> &x, const char * array[]) {
	for(const char **t = array; *t != NULL; ++t) { 
		x.insert(*t); 
	}
}

ITargets::ITargets() {
	players.insert("fighting-vehicle");

	players_and_monsters = players;
	players_and_monsters.insert("monster");

	const char *a2[] = {"cannon", "barrack", "pillbox", "fighting-vehicle", "trooper", "kamikaze", "boat", "helicopter", "monster", "watchtower", NULL};
	insert(troops, a2);

	troops_and_train = troops;
	troops_and_train.insert("train");

	troops_and_missiles = troops;
	troops_and_missiles.insert("missile");

	troops_train_and_missiles = troops_and_train;
	troops_train_and_missiles.insert("missile");
	
	const char *a4[] = {"fighting-vehicle", "trooper", "cannon", "watchtower", "creature", "civilian", "barrack", NULL};
	insert(monster, a4);

	const char *a5[] = {"fighting-vehicle", "trooper", "monster", "kamikaze", "barrack", NULL};
	insert(infantry, a5);

	infantry_and_train = infantry;
	infantry_and_train.insert("train");
}