engine/maps/source/MapUtils.cpp
// Get the number of adjacenct creatures
Get the number of adjacenct creatures
Get the number of adjacenct creatures
uint MapUtils::get_num_adjacent_creatures(const TileDirectionMap& adjacency_map)
{
  uint num_adjacent = 0;
  for (const TileDirectionMap::value_type& adjacent : adjacency_map)
  {
    TilePtr adjacent_tile = adjacent.second;
    if (adjacent_tile && adjacent_tile->has_creature())
    {
      num_adjacent++;
    }
  }
  return num_adjacent;
}
uint MapUtils :: get_num_adjacent_creatures ( const TileDirectionMap & adjacency_map ) { uint num_adjacent = 0 ; for ( const TileDirectionMap :: value_type & adjacent : adjacency_map ) { TilePtr adjacent_tile = adjacent . second ; if ( adjacent_tile && adjacent_tile -> has_creature ( ) ) { num_adjacent ++ ; } } return num_adjacent ; }
Get the number of adjacenct creatures
Get the number of adjacenct creatures