From c5b563366b04bc53fc48e5040447bab6ff1a6abb Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sun, 10 Jul 2005 12:06:08 +0000 Subject: [PATCH] added possibility to change cost --- botsrc/bot.h | 3 +++ copsrc/cop.h | 2 +- copsrc/copsrc.pro | 4 +--- robbersrc/robber.h | 2 +- robbersrc/robbersrc.pro | 4 +--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/botsrc/bot.h b/botsrc/bot.h index aad7473..15be234 100644 --- a/botsrc/bot.h +++ b/botsrc/bot.h @@ -84,6 +84,8 @@ class Bot { virtual void vote(); virtual void voteResult(); void getPlayers(); + template + std::list shortestPath(const std::string& from, PlayerType type, const Goal& goal, const Cost& cost, bool reverse = false); template std::list shortestPath(const std::string& from, PlayerType type, const Goal& goal, bool reverse = false); @@ -104,6 +106,7 @@ class Bot { __gnu_cxx::hash_map _winningPlans; }; + class SimpleSPGoal{ std::string _to; int _limit; diff --git a/copsrc/cop.h b/copsrc/cop.h index 6f8af75..ed53f41 100644 --- a/copsrc/cop.h +++ b/copsrc/cop.h @@ -1,7 +1,7 @@ #ifndef __COP_H__ #define __COP_H__ -#include +#include "../botsrc/bot.h" #include class Cop : public Bot { diff --git a/copsrc/copsrc.pro b/copsrc/copsrc.pro index f0edde6..4d2dfac 100644 --- a/copsrc/copsrc.pro +++ b/copsrc/copsrc.pro @@ -3,14 +3,12 @@ ###################################################################### TEMPLATE = app -INCLUDEPATH += ../botsrc CONFIG -= qt CONFIG += debug unix:LIBS += -lm TARGET = ../cop -QMAKE_CFLAGS_RELEASE += -march=athlon-xp # Input -HEADERS += cop.h +HEADERS += cop.h ../botsrc/bot.h ../botsrc/shortestPath.cpp SOURCES += cop.cpp ../botsrc/bot.cpp diff --git a/robbersrc/robber.h b/robbersrc/robber.h index b4f3e12..7624986 100644 --- a/robbersrc/robber.h +++ b/robbersrc/robber.h @@ -1,7 +1,7 @@ #ifndef __ROBBER_H__ #define __ROBBER_H__ -#include "bot.h" +#include "../botsrc/bot.h" class Robber : public Bot { public: diff --git a/robbersrc/robbersrc.pro b/robbersrc/robbersrc.pro index 1e0d738..e95eca1 100644 --- a/robbersrc/robbersrc.pro +++ b/robbersrc/robbersrc.pro @@ -3,14 +3,12 @@ ###################################################################### TEMPLATE = app -INCLUDEPATH += ../botsrc CONFIG -= qt #CONFIG += debug unix:LIBS += -lm TARGET = ../robber -#QMAKE_CXXFLAGS_RELEASE += -march=athlon-xp -g # Input -HEADERS += robber.h ../botsrc/bot.h +HEADERS += robber.h ../botsrc/bot.h ../botsrc/shortestPath.cpp SOURCES += robber.cpp ../botsrc/bot.cpp -- 2.39.2