From 5ad1cd32b2f630f413646131fbdfbae85b3c72f8 Mon Sep 17 00:00:00 2001 From: smatz Date: Tue, 3 Feb 2009 18:08:07 +0000 Subject: (svn r15324) -Codechange: unify the class used for comparing of strings for std::map --- src/ai/ai.hpp | 6 ++---- src/ai/ai_config.hpp | 7 ++----- src/ai/ai_scanner.hpp | 3 ++- src/ai/api/ai_controller.hpp | 6 ++---- 4 files changed, 8 insertions(+), 14 deletions(-) (limited to 'src/ai') diff --git a/src/ai/ai.hpp b/src/ai/ai.hpp index 0485cabae..2653e66ae 100644 --- a/src/ai/ai.hpp +++ b/src/ai/ai.hpp @@ -7,11 +7,9 @@ #include "api/ai_event_types.hpp" #include "../date_type.h" +#include "../core/string_compare_type.hpp" -#ifndef AI_CONFIG_HPP -struct ltstr { bool operator()(const char *s1, const char *s2) const { return strcmp(s1, s2) < 0; } }; -#endif /* AI_CONFIG_HPP */ -typedef std::map AIInfoList; +typedef std::map AIInfoList; void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2); diff --git a/src/ai/ai_config.hpp b/src/ai/ai_config.hpp index 39b680f1c..ca8b05a39 100644 --- a/src/ai/ai_config.hpp +++ b/src/ai/ai_config.hpp @@ -7,14 +7,11 @@ #include #include "ai_info.hpp" - -#ifndef AI_HPP -struct ltstr { bool operator()(const char *s1, const char *s2) const { return strcmp(s1, s2) < 0; } }; -#endif /* AI_HPP */ +#include "../core/string_compare_type.hpp" class AIConfig { private: - typedef std::map SettingValueList; + typedef std::map SettingValueList; public: AIConfig() : diff --git a/src/ai/ai_scanner.hpp b/src/ai/ai_scanner.hpp index 3bfa27bfc..9818288bb 100644 --- a/src/ai/ai_scanner.hpp +++ b/src/ai/ai_scanner.hpp @@ -5,6 +5,7 @@ #ifndef AI_SCANNER_HPP #define AI_SCANNER_HPP +#include "../core/string_compare_type.hpp" #include class AIScanner { @@ -73,7 +74,7 @@ public: bool HasAI(const struct ContentInfo *ci, bool md5sum); #endif private: - typedef std::map AILibraryList; + typedef std::map AILibraryList; /** * Scan the AI dir for scripts. diff --git a/src/ai/api/ai_controller.hpp b/src/ai/api/ai_controller.hpp index 1f1df743e..d4e2bd6dc 100644 --- a/src/ai/api/ai_controller.hpp +++ b/src/ai/api/ai_controller.hpp @@ -5,10 +5,8 @@ #ifndef AI_CONTROLLER_HPP #define AI_CONTROLLER_HPP +#include "../../core/string_compare_type.hpp" #include -#ifndef AI_HPP -struct ltstr { bool operator()(const char *s1, const char *s2) const { return strcmp(s1, s2) < 0; } }; -#endif /* AI_HPP */ /** * The Controller, the class each AI should extend. It creates the AI, makes @@ -85,7 +83,7 @@ public: static void Print(bool error_msg, const char *message); private: - typedef std::map LoadedLibraryList; + typedef std::map LoadedLibraryList; uint ticks; LoadedLibraryList loaded_library; -- cgit v1.2.3-70-g09d2