Author: crab
Date: Thu Jun 4 23:26:01 2009
New Revision: 36063
URL: http://svn.gna.org/viewcvs/wesnoth?rev=36063&view=rev
Log:
AI ai_command_history_item -> ai::command_history_item
Modified:
trunk/src/ai/ai_manager.cpp
trunk/src/ai/ai_manager.hpp
Modified: trunk/src/ai/ai_manager.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/ai_manager.cpp?rev=36063&r1=36062&r2=36063&view=diff
==============================================================================
--- trunk/src/ai/ai_manager.cpp (original)
+++ trunk/src/ai/ai_manager.cpp Thu Jun 4 23:26:01 2009
@@ -214,44 +214,44 @@
// AI COMMAND HISTORY ITEM
// =======================================================================
-ai_command_history_item::ai_command_history_item()
+command_history_item::command_history_item()
: number_(0), command_()
{
}
-ai_command_history_item::ai_command_history_item( int number, const
std::string& command )
+command_history_item::command_history_item( int number, const std::string&
command )
: number_(number), command_(command)
{
}
-ai_command_history_item::~ai_command_history_item()
-{
-
-}
-
-
-int ai_command_history_item::get_number() const
+command_history_item::~command_history_item()
+{
+
+}
+
+
+int command_history_item::get_number() const
{
return this->number_;
}
-void ai_command_history_item::set_number( int number )
+void command_history_item::set_number( int number )
{
this->number_ = number;
}
-const std::string& ai_command_history_item::get_command() const
+const std::string& command_history_item::get_command() const
{
return this->command_;
}
-void ai_command_history_item::set_command( const std::string& command )
+void command_history_item::set_command( const std::string& command )
{
this->command_ = command;
}
@@ -348,7 +348,7 @@
const std::string manager::evaluate_command( int side, const std::string& str )
{
//insert new command into history
-
history_.push_back(ai_command_history_item(history_item_counter_++,str));
+ history_.push_back(command_history_item(history_item_counter_++,str));
//prune history - erase 1/2 of it if it grows too large
if (history_.size()>MAX_HISTORY_SIZE){
@@ -380,7 +380,7 @@
}
-std::deque< ai_command_history_item > manager::history_;
+std::deque< command_history_item > manager::history_;
long manager::history_item_counter_ = 1;
//this is stub code to allow testing of basic 'history',
'repeat-last-command', 'add/remove/replace ai' capabilities.
@@ -418,7 +418,7 @@
int n = std::min<int>( MAX_HISTORY_VISIBLE, history_.size() );
std::stringstream strstream;
strstream << "AI MANAGER: History - last "<< n <<" commands:\n";
- std::deque< ai_command_history_item >::reverse_iterator j =
history_.rbegin();
+ std::deque< command_history_item >::reverse_iterator j =
history_.rbegin();
for (int cmd_id=n; cmd_id>0; --cmd_id){
strstream << j->get_number() << " :" <<
j->get_command() << '\n';
@@ -468,7 +468,7 @@
}
int command = lexical_cast<int>(cmd.at(1));
- std::deque< ai_command_history_item >::reverse_iterator
j = history_.rbegin();
+ std::deque< command_history_item >::reverse_iterator j
= history_.rbegin();
//yes, the iterator could be precisely positioned
(since command numbers go 1,2,3,4,..). will do it later.
while ( (j!=history_.rend()) &&
(j->get_number()!=command) ){
j++;// this is *reverse* iterator
Modified: trunk/src/ai/ai_manager.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/ai_manager.hpp?rev=36063&r1=36062&r2=36063&view=diff
==============================================================================
--- trunk/src/ai/ai_manager.hpp (original)
+++ trunk/src/ai/ai_manager.hpp Thu Jun 4 23:26:01 2009
@@ -97,13 +97,13 @@
/**
* AI Command History Item. It is an implementation detail
*/
-class ai_command_history_item{
+class command_history_item{
public:
- ai_command_history_item();
-
- ai_command_history_item(int number, const std::string& command);
-
- virtual ~ai_command_history_item();
+ command_history_item();
+
+ command_history_item(int number, const std::string& command);
+
+ virtual ~command_history_item();
int get_number() const;
void set_number(int number);
@@ -468,7 +468,7 @@
typedef std::map< int, std::stack< holder > > AI_map_of_stacks;
static AI_map_of_stacks ai_map_;
- static std::deque< ai_command_history_item > history_;
+ static std::deque< command_history_item > history_;
static long history_item_counter_;
static game_info *ai_info_;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits