mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 19:39:31 +00:00
Rename some misc classes to drop t_ prefix
This commit is contained in:
parent
8df0c0023c
commit
22bbe5465b
@ -28,9 +28,9 @@ struct shroud_clearing_action
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef std::vector<map_location> t_route;
|
typedef std::vector<map_location> route_t;
|
||||||
|
|
||||||
shroud_clearing_action(const unit_const_ptr u, const t_route::const_iterator& begin, const t_route::const_iterator& end, int village_owner, bool village_bonus)
|
shroud_clearing_action(const unit_const_ptr u, const route_t::const_iterator& begin, const route_t::const_iterator& end, int village_owner, bool village_bonus)
|
||||||
: route(begin, end)
|
: route(begin, end)
|
||||||
, view_info(*u)
|
, view_info(*u)
|
||||||
, original_village_owner(village_owner)
|
, original_village_owner(village_owner)
|
||||||
@ -41,7 +41,7 @@ struct shroud_clearing_action
|
|||||||
|
|
||||||
/// The hexes occupied by the affected unit during this action.
|
/// The hexes occupied by the affected unit during this action.
|
||||||
/// For recruits and recalls this only contains one hex.
|
/// For recruits and recalls this only contains one hex.
|
||||||
t_route route;
|
route_t route;
|
||||||
/// A record of the affected unit's ability to see.
|
/// A record of the affected unit's ability to see.
|
||||||
clearer_info view_info;
|
clearer_info view_info;
|
||||||
/// The number of the side that preivously owned the village that the unit stepped on
|
/// The number of the side that preivously owned the village that the unit stepped on
|
||||||
|
@ -55,8 +55,7 @@ public:
|
|||||||
const std::unique_ptr<actions::undo_list> undo_stack_;
|
const std::unique_ptr<actions::undo_list> undo_stack_;
|
||||||
int player_number_;
|
int player_number_;
|
||||||
|
|
||||||
typedef boost::optional<end_level_data> t_possible_end_level_data;
|
boost::optional<end_level_data> end_level_data_;
|
||||||
t_possible_end_level_data end_level_data_;
|
|
||||||
bool init_side_done_;
|
bool init_side_done_;
|
||||||
bool start_event_fired_;
|
bool start_event_fired_;
|
||||||
// used to sync with the mpserver
|
// used to sync with the mpserver
|
||||||
|
@ -265,7 +265,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
hk_scopes prev_scope_active_;
|
hk_scopes prev_scope_active_;
|
||||||
};
|
};
|
||||||
typedef boost::ptr_vector<hotkey_command> t_hotkey_command_list;
|
typedef boost::ptr_vector<hotkey_command> hotkey_command_list;
|
||||||
/// returns a container that contains all currently active hotkey_commands.
|
/// returns a container that contains all currently active hotkey_commands.
|
||||||
/// everything that wants a hotkey, must be in this container.
|
/// everything that wants a hotkey, must be in this container.
|
||||||
const boost::ptr_vector<hotkey_command>& get_hotkey_commands();
|
const boost::ptr_vector<hotkey_command>& get_hotkey_commands();
|
||||||
|
@ -3200,8 +3200,8 @@ int game_lua_kernel::intf_delay(lua_State *L)
|
|||||||
namespace { // Types
|
namespace { // Types
|
||||||
|
|
||||||
class recursion_preventer {
|
class recursion_preventer {
|
||||||
typedef std::map<map_location, int> t_counter;
|
typedef std::map<map_location, int> counter;
|
||||||
static t_counter counter_;
|
static counter counter_;
|
||||||
static const int max_recursion = 10;
|
static const int max_recursion = 10;
|
||||||
|
|
||||||
map_location loc_;
|
map_location loc_;
|
||||||
@ -3212,13 +3212,13 @@ namespace { // Types
|
|||||||
loc_(loc),
|
loc_(loc),
|
||||||
too_many_recursions_(false)
|
too_many_recursions_(false)
|
||||||
{
|
{
|
||||||
t_counter::iterator inserted = counter_.insert(std::make_pair(loc_, 0)).first;
|
counter::iterator inserted = counter_.insert(std::make_pair(loc_, 0)).first;
|
||||||
++inserted->second;
|
++inserted->second;
|
||||||
too_many_recursions_ = inserted->second >= max_recursion;
|
too_many_recursions_ = inserted->second >= max_recursion;
|
||||||
}
|
}
|
||||||
~recursion_preventer()
|
~recursion_preventer()
|
||||||
{
|
{
|
||||||
t_counter::iterator itor = counter_.find(loc_);
|
counter::iterator itor = counter_.find(loc_);
|
||||||
if (--itor->second == 0)
|
if (--itor->second == 0)
|
||||||
{
|
{
|
||||||
counter_.erase(itor);
|
counter_.erase(itor);
|
||||||
@ -3229,7 +3229,7 @@ namespace { // Types
|
|||||||
return too_many_recursions_;
|
return too_many_recursions_;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
recursion_preventer::t_counter recursion_preventer::counter_;
|
recursion_preventer::counter recursion_preventer::counter_;
|
||||||
typedef std::unique_ptr<recursion_preventer> recursion_preventer_ptr;
|
typedef std::unique_ptr<recursion_preventer> recursion_preventer_ptr;
|
||||||
} // end anonymouse namespace (types)
|
} // end anonymouse namespace (types)
|
||||||
|
|
||||||
|
@ -29,20 +29,20 @@ syncmp_handler::~syncmp_handler()
|
|||||||
std::vector<syncmp_handler*>& syncmp_registry::handlers()
|
std::vector<syncmp_handler*>& syncmp_registry::handlers()
|
||||||
{
|
{
|
||||||
//using pointer in order to prevent destruction at programm end. Although in this simple case it shouldn't matter.
|
//using pointer in order to prevent destruction at programm end. Although in this simple case it shouldn't matter.
|
||||||
static t_handlers* handlers_ = new t_handlers();
|
static handler_list* handlers_ = new handler_list();
|
||||||
return *handlers_;
|
return *handlers_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncmp_registry::remove_handler(syncmp_handler* handler)
|
void syncmp_registry::remove_handler(syncmp_handler* handler)
|
||||||
{
|
{
|
||||||
t_handlers::iterator elem = std::find(handlers().begin(), handlers().end(), handler);
|
handler_list::iterator elem = std::find(handlers().begin(), handlers().end(), handler);
|
||||||
assert(elem != handlers().end());
|
assert(elem != handlers().end());
|
||||||
handlers().erase(elem);
|
handlers().erase(elem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncmp_registry::add_handler(syncmp_handler* handler)
|
void syncmp_registry::add_handler(syncmp_handler* handler)
|
||||||
{
|
{
|
||||||
t_handlers::iterator elem = std::find(handlers().begin(), handlers().end(), handler);
|
handler_list::iterator elem = std::find(handlers().begin(), handlers().end(), handler);
|
||||||
assert(elem == handlers().end());
|
assert(elem == handlers().end());
|
||||||
handlers().push_back(handler);
|
handlers().push_back(handler);
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,10 @@ public:
|
|||||||
static void send_user_choice();
|
static void send_user_choice();
|
||||||
private:
|
private:
|
||||||
friend class syncmp_handler;
|
friend class syncmp_handler;
|
||||||
typedef std::vector<syncmp_handler*> t_handlers;
|
typedef std::vector<syncmp_handler*> handler_list;
|
||||||
static void remove_handler(syncmp_handler* handler);
|
static void remove_handler(syncmp_handler* handler);
|
||||||
static void add_handler(syncmp_handler* handler);
|
static void add_handler(syncmp_handler* handler);
|
||||||
static t_handlers& handlers();
|
static handler_list& handlers();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -501,7 +501,7 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<const variable_info_type vit>
|
template<const variable_info_type vit>
|
||||||
variable_info<vit>::variable_info(const std::string& varname, t_config& vars)
|
variable_info<vit>::variable_info(const std::string& varname, config_var& vars)
|
||||||
: name_(varname)
|
: name_(varname)
|
||||||
, state_(vars)
|
, state_(vars)
|
||||||
, valid_(true)
|
, valid_(true)
|
||||||
|
@ -37,9 +37,9 @@ class variable_info
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef typename variable_info_detail::maybe_const<vit,config>::type t_config;
|
typedef typename variable_info_detail::maybe_const<vit,config>::type config_var;
|
||||||
/// Doesn't throw
|
/// Doesn't throw
|
||||||
variable_info(const std::string& varname, t_config& vars);
|
variable_info(const std::string& varname, config_var& vars);
|
||||||
~variable_info();
|
~variable_info();
|
||||||
std::string get_error_message() const;
|
std::string get_error_message() const;
|
||||||
/// Doesn't throw
|
/// Doesn't throw
|
||||||
|
@ -67,9 +67,9 @@ namespace variable_info_detail
|
|||||||
template<const variable_info_type vit>
|
template<const variable_info_type vit>
|
||||||
struct variable_info_state
|
struct variable_info_state
|
||||||
{
|
{
|
||||||
typedef typename maybe_const<vit,config>::type t_child;
|
typedef typename maybe_const<vit,config>::type child_t;
|
||||||
|
|
||||||
variable_info_state(t_child& vars)
|
variable_info_state(child_t& vars)
|
||||||
: child_(&vars)
|
: child_(&vars)
|
||||||
, key_()
|
, key_()
|
||||||
, index_(0)
|
, index_(0)
|
||||||
@ -81,7 +81,7 @@ namespace variable_info_detail
|
|||||||
|
|
||||||
// The meaning of the following 3 depends on 'type_', but usualy the case is:
|
// The meaning of the following 3 depends on 'type_', but usualy the case is:
|
||||||
// the current config is child_->child_at(key_, index_).
|
// the current config is child_->child_at(key_, index_).
|
||||||
t_child* child_;
|
child_t* child_;
|
||||||
std::string key_;
|
std::string key_;
|
||||||
int index_;
|
int index_;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user