コード例 #1
0
ファイル: creature.cpp プロジェクト: kizzie/cboe
bool cCreature::is_friendly(const iLiving& other) const {
	if(is_friendly() != other.is_friendly())
		return false;
	if(const cCreature* monst = dynamic_cast<const cCreature*>(&other)) {
		if(!is_friendly()) return attitude == monst->attitude;
	}
	// If we get this far, both monsters are friendly to the player.
	// (Or, maybe the other is a player rather than a monster.)
	return true;
}
コード例 #2
0
ファイル: party.cpp プロジェクト: calref/cboe
bool cParty::is_friendly(const iLiving& other) const {
	return other.is_friendly();
}