AI Composite: new engine: formula ai engine (added a stub file)
This commit is contained in:
parent
c5753468b4
commit
b1db99c180
9 changed files with 152 additions and 1 deletions
|
@ -57,6 +57,8 @@
|
|||
<Unit filename="..\..\src\ai\composite\engine.hpp" />
|
||||
<Unit filename="..\..\src\ai\composite\engine_default.cpp" />
|
||||
<Unit filename="..\..\src\ai\composite\engine_default.hpp" />
|
||||
<Unit filename="..\..\src\ai\composite\engine_fai.cpp" />
|
||||
<Unit filename="..\..\src\ai\composite\engine_fai.hpp" />
|
||||
<Unit filename="..\..\src\ai\composite\rca.cpp" />
|
||||
<Unit filename="..\..\src\ai\composite\rca.hpp" />
|
||||
<Unit filename="..\..\src\ai\composite\stage.cpp" />
|
||||
|
|
|
@ -88,6 +88,8 @@
|
|||
<Unit filename="..\..\src\ai\composite\engine.hpp" />
|
||||
<Unit filename="..\..\src\ai\composite\engine_default.cpp" />
|
||||
<Unit filename="..\..\src\ai\composite\engine_default.hpp" />
|
||||
<Unit filename="..\..\src\ai\composite\engine_fai.cpp" />
|
||||
<Unit filename="..\..\src\ai\composite\engine_fai.hpp" />
|
||||
<Unit filename="..\..\src\ai\composite\rca.cpp" />
|
||||
<Unit filename="..\..\src\ai\composite\rca.hpp" />
|
||||
<Unit filename="..\..\src\ai\composite\stage.cpp" />
|
||||
|
|
|
@ -3344,6 +3344,34 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\composite\engine_fai.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\composite\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\composite\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug (fast)|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ObjectFile="$(IntDir)\ai\composite\"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\composite\rca.cpp"
|
||||
>
|
||||
|
@ -4747,6 +4775,10 @@
|
|||
RelativePath="..\..\src\ai\composite\engine_default.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\composite\engine_fai.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\ai\composite\rca.hpp"
|
||||
>
|
||||
|
|
|
@ -222,6 +222,7 @@ SET(wesnoth-main_SRC
|
|||
ai/composite/contexts.cpp
|
||||
ai/composite/engine.cpp
|
||||
ai/composite/engine_default.cpp
|
||||
ai/composite/engine_fai.cpp
|
||||
ai/composite/rca.cpp
|
||||
ai/composite/stage.cpp
|
||||
ai/configuration.cpp
|
||||
|
|
|
@ -47,6 +47,7 @@ wesnoth_source = \
|
|||
ai/composite/contexts.cpp \
|
||||
ai/composite/engine.cpp \
|
||||
ai/composite/engine_default.cpp \
|
||||
ai/composite/engine_fai.cpp \
|
||||
ai/composite/rca.cpp \
|
||||
ai/composite/stage.cpp \
|
||||
ai/configuration.cpp \
|
||||
|
|
|
@ -152,6 +152,7 @@ wesnoth_sources = Split("""
|
|||
ai/composite/contexts.cpp
|
||||
ai/composite/engine.cpp
|
||||
ai/composite/engine_default.cpp
|
||||
ai/composite/engine_fai.cpp
|
||||
ai/composite/rca.cpp
|
||||
ai/composite/stage.cpp
|
||||
ai/configuration.cpp
|
||||
|
|
59
src/ai/composite/engine_fai.cpp
Normal file
59
src/ai/composite/engine_fai.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2009 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 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* CPP AI Support engine - creating specific ai components from config
|
||||
* @file ai/composite/engine_default.cpp
|
||||
*/
|
||||
|
||||
#include "ai.hpp"
|
||||
#include "engine_fai.hpp"
|
||||
#include "rca.hpp"
|
||||
#include "../../foreach.hpp"
|
||||
#include "../../log.hpp"
|
||||
|
||||
namespace ai {
|
||||
|
||||
namespace composite_ai {
|
||||
|
||||
static lg::log_domain log_ai_composite_engine_fai("ai/composite/engine/fai");
|
||||
#define DBG_AI_COMPOSITE_ENGINE_FAI LOG_STREAM(debug, log_ai_composite_engine_fai)
|
||||
#define LOG_AI_COMPOSITE_ENGINE_FAI LOG_STREAM(info, log_ai_composite_engine_fai)
|
||||
#define ERR_AI_COMPOSITE_ENGINE_FAI LOG_STREAM(err, log_ai_composite_engine_fai)
|
||||
|
||||
engine_fai::engine_fai( composite_ai_context &context, const config &cfg )
|
||||
: engine(context,cfg)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
engine_fai::~engine_fai()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void engine_fai::do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b ){
|
||||
//*b = new_candidate_action;
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::string engine_fai::get_name()
|
||||
{
|
||||
return "fai";
|
||||
}
|
||||
|
||||
} //end of namespace composite_ai
|
||||
|
||||
} //end of namespace ai
|
49
src/ai/composite/engine_fai.hpp
Normal file
49
src/ai/composite/engine_fai.hpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2009 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 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* CPP AI Support engine - creating specific ai components from config
|
||||
* @file ai/composite/engine_fai.hpp
|
||||
*/
|
||||
|
||||
#ifndef AI_COMPOSITE_ENGINE_FAI_HPP_INCLUDED
|
||||
#define AI_COMPOSITE_ENGINE_FAI_HPP_INCLUDED
|
||||
|
||||
#include "../../global.hpp"
|
||||
|
||||
#include "engine.hpp"
|
||||
#include "../contexts.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
//============================================================================
|
||||
namespace ai {
|
||||
|
||||
namespace composite_ai {
|
||||
|
||||
class engine_fai : public engine {
|
||||
public:
|
||||
engine_fai( composite_ai_context &context, const config &cfg );
|
||||
|
||||
virtual ~engine_fai();
|
||||
|
||||
virtual void do_parse_candidate_action_from_config( rca_context &context, const config &cfg, std::back_insert_iterator<std::vector< candidate_action_ptr > > b );
|
||||
|
||||
virtual std::string get_name();
|
||||
};
|
||||
|
||||
} //end of namespace composite_ai
|
||||
|
||||
} //end of namespace ai
|
||||
|
||||
#endif
|
|
@ -20,6 +20,7 @@
|
|||
#include "ai2/ai.hpp"
|
||||
#include "composite/ai.hpp"
|
||||
#include "composite/engine_default.hpp"
|
||||
#include "composite/engine_fai.hpp"
|
||||
#include "default/ai.hpp"
|
||||
#include "dfool/ai.hpp"
|
||||
#include "formula/ai.hpp"
|
||||
|
@ -47,7 +48,10 @@ static register_ai_factory<composite_ai::ai_composite> ai_composite_ai_factory("
|
|||
// =======================================================================
|
||||
|
||||
static composite_ai::register_engine_factory<composite_ai::engine_cpp>
|
||||
composite_ai_factory("cpp");
|
||||
composite_ai_factory_cpp("cpp");
|
||||
|
||||
static composite_ai::register_engine_factory<composite_ai::engine_fai>
|
||||
composite_ai_factory_fai("fai");
|
||||
|
||||
// =======================================================================
|
||||
// Stages
|
||||
|
|
Loading…
Add table
Reference in a new issue