engine/translators/source/MapTranslator.cpp
// Create the tile to display, based on the tile's properties, and whether or
// not the player's been blinded.  If the player's been blinded, the tile will
// be black, unless it is the player's tile, in which case the player will be
// displayed.
Create the tile to display, based on the tile's properties, and whether or
not the player's been blinded.  If the player's been blinded, the tile will
be black, unless it is the player's tile, in which case the player will be
displayed.
Create the tile to display based on the tile ' s properties and whether or not the player ' s been blinded . If the player ' s been blinded the tile will be black unless it is the player ' s tile in which case the player will be displayed .
DisplayTile MapTranslator::create_display_tile(const bool player_blinded, const bool timewalking, const pair<Colour, Colour>& tod_overrides, const ShimmerColours& shimmer_colours, const TilePtr& actual_tile, const TilePtr& fov_tile)
{
  DisplayTile display_tile;
  if ((fov_tile && !player_blinded) || (player_blinded && fov_tile && fov_tile->get_creature() && fov_tile->get_creature()->get_is_player()))
  {
    CreaturePtr creature = actual_tile->get_creature();
    IInventoryPtr inv = actual_tile->get_items();
    FeaturePtr feature = actual_tile->get_feature();
    if (creature)
    {
      display_tile = create_display_tile_from_creature(creature, tod_overrides.second);
    }
    else if (!inv->empty() && !player_blinded) 
    {
      ItemPtr item = inv->at(0); 
      if (item != nullptr)
      {
        display_tile = create_display_tile_from_item(item, tod_overrides.second);
      }
    }
    else if (feature && !feature->get_is_hidden() && !player_blinded) 
    {
      display_tile = create_display_tile_from_feature(feature, timewalking, tod_overrides.second, shimmer_colours);
    }
    else 
    {
      display_tile = create_display_tile_from_tile(actual_tile, timewalking, tod_overrides.first, shimmer_colours);
    }      
  }
  else
  {
    if (actual_tile && actual_tile->get_explored() && !player_blinded)
    {
      display_tile = create_unseen_and_explored_display_tile(actual_tile, timewalking, tod_overrides, shimmer_colours);
    }
    else
    {
      if (actual_tile && actual_tile->get_viewed() && !player_blinded)
      {
        display_tile = create_unseen_and_previously_viewed_display_tile(actual_tile, timewalking, tod_overrides, shimmer_colours);
      }
      else
      {
        display_tile = create_unseen_and_unexplored_display_tile();
      }
    }
  }
  return display_tile;
}
DisplayTile MapTranslator :: create_display_tile ( const bool player_blinded , const bool timewalking , const pair < Colour , Colour > & tod_overrides , const ShimmerColours & shimmer_colours , const TilePtr & actual_tile , const TilePtr & fov_tile ) { DisplayTile display_tile ; if ( ( fov_tile && ! player_blinded ) || ( player_blinded && fov_tile && fov_tile -> get_creature ( ) && fov_tile -> get_creature ( ) -> get_is_player ( ) ) ) { CreaturePtr creature = actual_tile -> get_creature ( ) ; IInventoryPtr inv = actual_tile -> get_items ( ) ; FeaturePtr feature = actual_tile -> get_feature ( ) ; if ( creature ) { display_tile = create_display_tile_from_creature ( creature , tod_overrides . second ) ; } else if ( ! inv -> empty ( ) && ! player_blinded ) { ItemPtr item = inv -> at ( 0 ) ; if ( item != nullptr ) { display_tile = create_display_tile_from_item ( item , tod_overrides . second ) ; } } else if ( feature && ! feature -> get_is_hidden ( ) && ! player_blinded ) { display_tile = create_display_tile_from_feature ( feature , timewalking , tod_overrides . second , shimmer_colours ) ; } else { display_tile = create_display_tile_from_tile ( actual_tile , timewalking , tod_overrides . first , shimmer_colours ) ; } } else { if ( actual_tile && actual_tile -> get_explored ( ) && ! player_blinded ) { display_tile = create_unseen_and_explored_display_tile ( actual_tile , timewalking , tod_overrides , shimmer_colours ) ; } else { if ( actual_tile && actual_tile -> get_viewed ( ) && ! player_blinded ) { display_tile = create_unseen_and_previously_viewed_display_tile ( actual_tile , timewalking , tod_overrides , shimmer_colours ) ; } else { display_tile = create_unseen_and_unexplored_display_tile ( ) ; } } } return display_tile ; }
Create the tile to display, based on the tile's properties, and whether or
not the player's been blinded.
Create the tile to display based on the tile ' s properties and whether or not the player ' s been blinded .
// Is it a FOV tile, and is the player not blinded? // Special case for blindness - does the tile contain the player?  Because // we always want to show the player. // If a creature exists on this tile - will be null if the ptr is not init'd. // Display the creature if the player is not blind, or if the player is the // creature (presumably, the player always has a sense of where they are!). // If at least one item exists in the tile's inventory of items // Get the first item // There's no creature, and no items.  Is there a feature?  Can it be seen? // Nothing else, or the player is blind - display the tile only.