engine/maps/source/MapUtils.cpp
// Determine how many adjacent tiles are available to the creature
Determine how many adjacent tiles are available to the creature
Determine how many adjacent tiles are available to the creature
uint MapUtils::get_num_adjacent_movement_directions(const MapPtr& map, const CreaturePtr& creature)
{
  uint num_dirs = 0;
  TileDirectionMap tdm = MapUtils::get_adjacent_tiles_to_creature(map, creature);
  for (const auto& tdm_pair : tdm)
  {
    if (tdm_pair.second != nullptr)
    {
      TilePtr tile = tdm_pair.second;
      if (MapUtils::is_tile_available_for_creature(creature, tile))
      {
        num_dirs++;
      }
    }
  }
  return num_dirs;
}
uint MapUtils :: get_num_adjacent_movement_directions ( const MapPtr & map , const CreaturePtr & creature ) { uint num_dirs = 0 ; TileDirectionMap tdm = MapUtils :: get_adjacent_tiles_to_creature ( map , creature ) ; for ( const auto & tdm_pair : tdm ) { if ( tdm_pair . second != nullptr ) { TilePtr tile = tdm_pair . second ; if ( MapUtils :: is_tile_available_for_creature ( creature , tile ) ) { num_dirs ++ ; } } } return num_dirs ; }
Determine how many adjacent tiles are available to the creature
Determine how many adjacent tiles are available to the creature