---
#------------------------------------------------------------
# This is the schema for product configuration version 1.5
#------------------------------------------------------------

#------------------------------------------------------------
# Type alias
#------------------------------------------------------------
type_alias:
  news_list_type:
    type: list
    list_type: rss_feed_type
  
  rss_feed_type:
    type: map
    map_schema:
      source:
      name:
      url_root:
      title_max_length:
        type: number
      description_max_length:
        type: number
  
  rss_feed_list_type:
    type: list
    list_type: rss_feed_type
    
  uplay_type:
    type: map
    map_schema:
      help_url:
      game_code:
      platform_code:
        required: no
        
  login_banner_type:
    type: map
    map_schema:
      image:
      url:
  
  exe_type:
    type: map
    map_schema:
      exe:
      additional_arguments:
        required: no
    
  #------------------------------------------------------------
  # Root type
  #------------------------------------------------------------
  root_type:
    type: map
    map_schema:
    
    # Common --------------------------------------------------
      # required fields
      name:
      forum_url:
      homepage_url:
      savegame_sync_enabled:
        type: yesno
      buy_url:

      # optional fields
      uplay: # Uplay information for this game
        type: uplay_type
        required: no
        
      facebook_url: # Link to the games facebook page
        required: no
      
      news: # News feeds for the game
        type: rss_feed_list_type
        required: no
        
      offline_exe:
        type: exe_type
        required: no
        
      settings_exe:
        required: no

    # Splash screen -------------------------------------------
      splash_background_image:
      
    # Login screen --------------------------------------------
      # required fields
      login_background_image:
      login_logo_image:    
      
      # optional fields
      login_banner_1:
        type: login_banner_type
        required: no
      login_banner_2:
        type: login_banner_type
        required: no
      login_banner_3:
        type: login_banner_type
        required: no
        
    # Register account screen ---------------------------------
      # required fields
      register_account_background_image:
      
    # Enter cd key/bind game to account screen ----------------
      # required fields
      enter_key_background_image:
      enter_key_silent_mode_enabled:
        type: yesno       
      enter_key_buy_button_enabled:
        type: yesno             
        
    # Main game screen ----------------------------------------
      # required fields
      main_background_image:
      main_logo_image:
      
      main_game_to_web_url: # visual link, replaced by webview if defined
      main_game_to_web_image:
      main_ad_enabled: # Enable/disable ads on the main game view
        type: yesno
      
      # optional fields
      main_game_to_web_webview_url:
        required: no

    # After game report screen --------------------------------
      # required fields      
      after_game_report_enabled: 
        type: yesno
      after_game_report_ad_enabled:
        type: yesno
      # optional fields      
      after_game_report_game_to_web_webview_url:
        required: no

    # Survey screen -------------------------------------------
      survey_url:
        required: no

    # Rewards screen ------------------------------------------
      # required fields      
      rewards_buy_this_game_button_enabled: # Enable/disable a button that links to the uplay shop
        type: yesno

  #------------------------------------------------------------
  # Sku override type
  #------------------------------------------------------------
  sku_overrides_type:
    type: root_type
    # ignore_required means that while we are checking the root_type, we ignore required, so all items are not required
    ignore_required_in_subtype: yes 
  
  sku_type:  
    type: map
    map_schema:
      overrides:
        type: sku_overrides_type
        required: no
      deletions:
        type: list        
        required: no
        
  localization_type:
    type: map

#--------------------------------------------------------------
# Schema
#--------------------------------------------------------------
schema:
  type: map
  map_schema:
    # Specifies the version of the configuration
    version:
    # This is where the root of the configuration is found
    root:
      type: root_type
    # SKU overrides are optional and can be skipped
    skus:
      type: map
      required: no
      map_type: sku_type
     # Localizations are optional and can be skipped
    localizations:
      type: map
      required: no
      map_type: localization_type
          