The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Typedefs | Functions
unit.hpp File Reference
#include <boost/tuple/tuple.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/variant.hpp>
#include "units/types.hpp"
#include "units/ptr.hpp"
#include "units/id.hpp"
Include dependency graph for unit.hpp:

Go to the source code of this file.

Classes

class  unit_ability_list
 
class  unit
 
struct  unit::upkeep_full
 
struct  unit::upkeep_loyal
 
struct  unit_movement_resetter
 Object which temporarily resets a unit's movement. More...
 

Namespaces

 unit_detail
 

Typedefs

typedef std::pair< const
config *, map_location
unit_ability
 The things contained within a unit_ability_list. More...
 

Functions

template<typename T >
const T & unit_detail::get_or_default (const boost::scoped_ptr< T > &v)
 
std::string get_checksum (const unit &u)
 Gets a checksum for a unit. More...
 

Typedef Documentation

typedef std::pair<const config *, map_location> unit_ability

The things contained within a unit_ability_list.

Definition at line 43 of file unit.hpp.

Function Documentation

std::string get_checksum ( const unit u)

Gets a checksum for a unit.

In MP games the descriptions are locally generated and might differ, so it should be possible to discard them. Not sure whether replays suffer the same problem.

Parameters
uthe unit
Returns
the checksum for a unit

Definition at line 2511 of file unit.cpp.

References config::add_child(), config::child_range(), DBG_UT, config::hash(), i, config::recursive_clear_value(), and unit::write().

Referenced by replay::add_unit_checksum().