added a few comments

This commit is contained in:
Dominic Bolin 2006-03-26 21:55:28 +00:00
parent d40a1f336f
commit 2dfef114f4
3 changed files with 37 additions and 1 deletions

View File

@ -158,6 +158,7 @@ class unit
bool has_moved() const;
bool has_goto() const;
int emits_zoc() const;
/* cfg: standard unit filter */
bool matches_filter(const config& cfg,const gamemap::location& loc,bool use_flat_tod=false) const;
void add_overlay(const std::string& overlay);
void remove_overlay(const std::string& overlay);
@ -274,10 +275,12 @@ class unit
private:
/*
* cfg: an ability WML structure
*/
bool ability_active(const std::string& ability,const config& cfg,const gamemap::location& loc) const;
bool ability_affects_adjacent(const std::string& ability,const config& cfg,int dir,const gamemap::location& loc) const;
bool ability_affects_self(const std::string& ability,const config& cfg,const gamemap::location& loc) const;
bool resistance_filter_matches(const config& cfg,const gamemap::location& loc,bool attacker,const attack_type& damage_type) const;
config cfg_;

View File

@ -263,6 +263,11 @@ std::vector<std::string> unit::ability_tooltips(const gamemap::location& loc) co
return res;
}
/*
*
* cfg: an ability WML structure
*
*/
bool unit::ability_active(const std::string& ability,const config& cfg,const gamemap::location& loc) const
{
@ -342,6 +347,11 @@ bool unit::ability_active(const std::string& ability,const config& cfg,const gam
}
return true;
}
/*
*
* cfg: an ability WML structure
*
*/
bool unit::ability_affects_adjacent(const std::string& ability,const config& cfg,int dir,const gamemap::location& loc) const
{
// wassert("not done" == "done");
@ -365,6 +375,11 @@ bool unit::ability_affects_adjacent(const std::string& ability,const config& cfg
}
return passed;
}
/*
*
* cfg: an ability WML structure
*
*/
bool unit::ability_affects_self(const std::string& ability,const config& cfg,const gamemap::location& loc) const
{
if(cfg.child("filter")==NULL) {
@ -597,6 +612,11 @@ std::string attack_type::weapon_specials(bool force) const
/*
*
* cfg: a weapon special WML structure
*
*/
bool attack_type::special_active(const config& cfg,bool self) const
{
log_scope("special_active");
@ -774,6 +794,11 @@ bool attack_type::special_active(const config& cfg,bool self) const
}
return true;
}
/*
*
* cfg: a weapon special WML structure
*
*/
bool attack_type::special_affects_opponent(const config& cfg) const
{
log_scope("special_affects_opponent");
@ -790,6 +815,11 @@ bool attack_type::special_affects_opponent(const config& cfg) const
}
return false;
}
/*
*
* cfg: a weapon special WML structure
*
*/
bool attack_type::special_affects_self(const config& cfg) const
{
log_scope("special_affects_self");

View File

@ -90,6 +90,9 @@ private:
const gamestatus* game_status_;
const std::vector<team>* teams_;
mutable attack_type* other_attack_;
/*
* cfg: a weapon special WML structure
*/
bool special_active(const config& cfg,bool self) const;
bool special_affects_opponent(const config& cfg) const;
bool special_affects_self(const config& cfg) const;