stub code for new candidate action for gnew ai lobal_fallback stage,
This commit is contained in:
parent
193cf7e9ad
commit
6df240e341
8 changed files with 175 additions and 1 deletions
|
@ -110,6 +110,8 @@
|
|||
<Unit filename="..\..\src\ai\testing\aspect_attacks.hpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca.cpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca.hpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_global_fallback.cpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_global_fallback.hpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_testing_move_to_targets.cpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_testing_move_to_targets.hpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_testing_recruitment.cpp" />
|
||||
|
|
|
@ -140,6 +140,8 @@
|
|||
<Unit filename="..\..\src\ai\testing\aspect_attacks.hpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca.cpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca.hpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_global_fallback.cpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_global_fallback.hpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_testing_move_to_targets.cpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_testing_move_to_targets.hpp" />
|
||||
<Unit filename="..\..\src\ai\testing\ca_testing_recruitment.cpp" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
|
@ -6302,6 +6302,34 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\testing\ca_global_fallback.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug (fast)|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\testing\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\testing\ca_testing_move_to_targets.cpp"
|
||||
>
|
||||
|
@ -8093,6 +8121,10 @@
|
|||
RelativePath="..\..\src\ai\testing\ca.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\testing\ca_global_fallback.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\testing\ca_testing_move_to_targets.hpp"
|
||||
>
|
||||
|
|
|
@ -317,6 +317,7 @@ set(wesnoth-main_SRC
|
|||
ai/registry.cpp
|
||||
ai/testing/aspect_attacks.cpp
|
||||
ai/testing/ca.cpp
|
||||
ai/testing/ca_global_fallback.cpp
|
||||
ai/testing/ca_testing_move_to_targets.cpp
|
||||
ai/testing/ca_testing_recruitment.cpp
|
||||
ai/testing/stage_rca.cpp
|
||||
|
|
|
@ -188,6 +188,7 @@ wesnoth_sources = Split("""
|
|||
ai/registry.cpp
|
||||
ai/testing/aspect_attacks.cpp
|
||||
ai/testing/ca.cpp
|
||||
ai/testing/ca_global_fallback.cpp
|
||||
ai/testing/ca_testing_move_to_targets.cpp
|
||||
ai/testing/ca_testing_recruitment.cpp
|
||||
ai/testing/stage_rca.cpp
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "testing/ca.hpp"
|
||||
#include "testing/ca_testing_move_to_targets.hpp"
|
||||
#include "testing/ca_testing_recruitment.hpp"
|
||||
#include "testing/ca_global_fallback.hpp"
|
||||
#include "testing/stage_rca.hpp"
|
||||
#include "testing/stage_fallback.hpp"
|
||||
|
||||
|
@ -123,6 +124,9 @@ static register_candidate_action_factory<testing_ai_default::testing_recruitment
|
|||
static register_candidate_action_factory<testing_ai_default::passive_leader_shares_keep_phase>
|
||||
passive_leader_shares_keep_phase_factory("testing_ai_default::passive_leader_shares_keep_phase");
|
||||
|
||||
static register_candidate_action_factory<testing_ai_default::global_fallback_phase>
|
||||
global_fallback_phase_factory("testing_ai_default::global_fallback_phase");
|
||||
|
||||
// =======================================================================
|
||||
// Goals
|
||||
// =======================================================================
|
||||
|
|
72
src/ai/testing/ca_global_fallback.cpp
Normal file
72
src/ai/testing/ca_global_fallback.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2009 - 2011 by Yurii Chernyi <terraninfo@terraninfo.net>
|
||||
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 as published by
|
||||
the Free Software Foundation; either version 2 of the License, 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
|
||||
* Defensive fallback, to be used during unfavourable conditions
|
||||
*/
|
||||
|
||||
#include "ca_global_fallback.hpp"
|
||||
|
||||
#include "../composite/ai.hpp"
|
||||
|
||||
#include "../../log.hpp"
|
||||
|
||||
/*
|
||||
#include "../actions.hpp"
|
||||
#include "../../foreach.hpp"
|
||||
#include "../../map.hpp"
|
||||
#include "../../resources.hpp"
|
||||
#include "../../team.hpp"
|
||||
|
||||
#include <deque>
|
||||
*/
|
||||
|
||||
namespace ai {
|
||||
|
||||
namespace testing_ai_default {
|
||||
|
||||
static lg::log_domain log_ai_testing_ca_global_fallback("ai/ca/global_fallback");
|
||||
#define DBG_AI LOG_STREAM(debug, log_ai_testing_ca_global_fallback)
|
||||
#define LOG_AI LOG_STREAM(info, log_ai_testing_ca_global_fallback)
|
||||
#define WRN_AI LOG_STREAM(warn, log_ai_testing_ca_global_fallback)
|
||||
#define ERR_AI LOG_STREAM(err, log_ai_testing_ca_global_fallback)
|
||||
|
||||
|
||||
global_fallback_phase::global_fallback_phase( rca_context &context, const config &cfg )
|
||||
: candidate_action(context,cfg)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
global_fallback_phase::~global_fallback_phase()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
double global_fallback_phase::evaluate()
|
||||
{
|
||||
return get_score();
|
||||
}
|
||||
|
||||
|
||||
void global_fallback_phase::execute()
|
||||
{
|
||||
//@todo: implement
|
||||
}
|
||||
|
||||
} // end of namespace testing_ai_default
|
||||
|
||||
} // end of namespace ai
|
60
src/ai/testing/ca_global_fallback.hpp
Normal file
60
src/ai/testing/ca_global_fallback.hpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2009 - 2011 by Yurii Chernyi <terraninfo@terraninfo.net>
|
||||
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 as published by
|
||||
the Free Software Foundation; either version 2 of the License, 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
|
||||
* Strategic movement routine, for experimentation
|
||||
*/
|
||||
|
||||
#ifndef AI_TESTING_CA_TESTING_GLOBAL_FALLBACK_HPP_INCLUDED
|
||||
#define AI_TESTING_CA_TESTING_GLOBAL_FALLBACK_HPP_INCLUDED
|
||||
|
||||
#include "../composite/rca.hpp"
|
||||
|
||||
#include "../../unit_map.hpp"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
//silence "inherits via dominance" warnings
|
||||
#pragma warning(disable:4250)
|
||||
#endif
|
||||
|
||||
namespace ai {
|
||||
|
||||
namespace testing_ai_default {
|
||||
|
||||
class global_fallback_phase : public candidate_action {
|
||||
public:
|
||||
|
||||
global_fallback_phase( rca_context &context, const config &cfg );
|
||||
|
||||
virtual ~global_fallback_phase();
|
||||
|
||||
virtual double evaluate();
|
||||
|
||||
virtual void execute();
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
} // of namespace testing_ai_default
|
||||
|
||||
} // of namespace ai
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue