From ab540dca1517e82d0f93153604cdb00f256becd6 Mon Sep 17 00:00:00 2001 From: Iurii Chernyi Date: Wed, 29 Apr 2009 01:28:05 +0000 Subject: [PATCH] New source file pair: ai/testing.[ch]pp... Modified automake/cmake/scons/MSVC9 build configs. --- projectfiles/VC9/wesnoth.vcproj | 8 ++++++ src/CMakeLists.txt | 1 + src/Makefile.am | 1 + src/SConscript | 1 + src/ai/testing.cpp | 41 ++++++++++++++++++++++++++ src/ai/testing.hpp | 51 +++++++++++++++++++++++++++++++++ 6 files changed, 103 insertions(+) create mode 100644 src/ai/testing.cpp create mode 100644 src/ai/testing.hpp diff --git a/projectfiles/VC9/wesnoth.vcproj b/projectfiles/VC9/wesnoth.vcproj index 0814fdd7710..d259c85e226 100644 --- a/projectfiles/VC9/wesnoth.vcproj +++ b/projectfiles/VC9/wesnoth.vcproj @@ -2765,6 +2765,10 @@ RelativePath="..\..\src\ai\formula_candidates.cpp" > + + + + + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + +/** + * Gather statistics important for AI testing and output them + * @file ai/testing.cpp + */ +#include "testing.hpp" +#include "../log.hpp" + +static lg::log_domain log_ai_testing("ai/testing"); +#define DBG_AI_TESTING LOG_STREAM(debug, log_ai_testing) +#define LOG_AI_TESTING LOG_STREAM(info, log_ai_testing) +#define ERR_AI_TESTING LOG_STREAM(err, log_ai_testing) + +void ai_testing::log_turn_start() +{ +} + +void ai_testing::log_draw() +{ +} + +void ai_testing::log_victory() +{ +} + +void ai_testing::log_unknown_error_while_playing_level() +{ +} diff --git a/src/ai/testing.hpp b/src/ai/testing.hpp new file mode 100644 index 00000000000..5d2ffef7e63 --- /dev/null +++ b/src/ai/testing.hpp @@ -0,0 +1,51 @@ +/* $Id$ */ +/* + Copyright (C) 2009 by Yurii Chernyi + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + +/** + * @file ai/testing.hpp + * Gather statistics important for AI testing and output them + */ + +#ifndef AI_TESTING_HPP_INCLUDED +#define AI_TESTING_HPP_INCLUDED + +#include "../global.hpp" + +class ai_testing{ +public: + /* + * Log at start of the turn + */ + static void log_turn_start(); + + + /* + * Log in case of draw + */ + static void log_draw(); + + + /* + * Log in case of victory + */ + static void log_victory(); + + + /* + * Log in case of unknown error while playing level + */ + static void log_unknown_error_while_playing_level(); +}; + +#endif