<commit_before>﻿using System;
using System.Collections.Generic;
using SteamNative;

namespace Facepunch.Steamworks
{
    /// <summary>
    /// Allows you to interact with Steam's UGC stuff (User Generated Content).
    /// To put simply, this allows you to upload a folder of files to Steam.
    /// 
    /// To upload a new file use CreateItem. This returns an Editor object.
    /// This object is also used to edit existing items.
    /// 
    /// To get a list of items you can call CreateQuery. From there you can download
    /// an item and retrieve the folder that it's downloaded to. 
    /// 
    /// Generally there's no need to compress and decompress your uploads, so you should
    /// usually be able to use the content straight from the destination folder.
    /// 
    /// </summary>
    public partial class Workshop : IDisposable
    {
        internal const ulong InvalidHandle = 0xffffffffffffffff;

        internal SteamNative.SteamUGC ugc;
        internal Friends friends;
        internal BaseSteamworks steamworks;
        internal SteamNative.SteamRemoteStorage remoteStorage;

        /// <summary>
        /// Called when an item has been downloaded. This could have been
        /// because of a call to Download or because of a subscription triggered
        /// via the browser/app.
        /// </summary>
        public event Action<ulong, Callbacks.Result> OnFileDownloaded;

        /// <summary>
        /// Called when an item has been installed. This could have been
        /// because of a call to Download or because of a subscription triggered
        /// via the browser/app.
        /// </summary>
        public event Action<ulong> OnItemInstalled;

        internal Workshop( BaseSteamworks steamworks, SteamNative.SteamUGC ugc, SteamNative.SteamRemoteStorage remoteStorage )
        {
            this.ugc = ugc;
            this.steamworks = steamworks;
            this.remoteStorage = remoteStorage;

            SteamNative.DownloadItemResult_t.RegisterCallback( steamworks, onDownloadResult );
            SteamNative.ItemInstalled_t.RegisterCallback( steamworks, onItemInstalled );
        }

        /// <summary>
        /// You should never have to call this manually
        /// </summary>
        public void Dispose()
        {
            ugc = null;
            steamworks = null;
            remoteStorage = null;
            friends = null;<commit_msg>Modified summary for OnFileDownloaded to more accurately represent my experience with the event.<commit_after>﻿using System;
using System.Collections.Generic;
using SteamNative;

namespace Facepunch.Steamworks
{
    /// <summary>
    /// Allows you to interact with Steam's UGC stuff (User Generated Content).
    /// To put simply, this allows you to upload a folder of files to Steam.
    /// 
    /// To upload a new file use CreateItem. This returns an Editor object.
    /// This object is also used to edit existing items.
    /// 
    /// To get a list of items you can call CreateQuery. From there you can download
    /// an item and retrieve the folder that it's downloaded to. 
    /// 
    /// Generally there's no need to compress and decompress your uploads, so you should
    /// usually be able to use the content straight from the destination folder.
    /// 
    /// </summary>
    public partial class Workshop : IDisposable
    {
        internal const ulong InvalidHandle = 0xffffffffffffffff;

        internal SteamNative.SteamUGC ugc;
        internal Friends friends;
        internal BaseSteamworks steamworks;
        internal SteamNative.SteamRemoteStorage remoteStorage;

        /// <summary>
        /// Called when an item has been downloaded. This could have been
        /// because of a call to Download.
        /// </summary>
        public event Action<ulong, Callbacks.Result> OnFileDownloaded;

        /// <summary>
        /// Called when an item has been installed. This could have been
        /// because of a call to Download or because of a subscription triggered
        /// via the browser/app.
        /// </summary>
        public event Action<ulong> OnItemInstalled;

        internal Workshop( BaseSteamworks steamworks, SteamNative.SteamUGC ugc, SteamNative.SteamRemoteStorage remoteStorage )
        {
            this.ugc = ugc;
            this.steamworks = steamworks;
            this.remoteStorage = remoteStorage;

            SteamNative.DownloadItemResult_t.RegisterCallback( steamworks, onDownloadResult );
            SteamNative.ItemInstalled_t.RegisterCallback( steamworks, onItemInstalled );
        }

        /// <summary>
        /// You should never have to call this manually
        /// </summary>
        public void Dispose()
        {
            ugc = null;
            steamworks = null;
            remoteStorage = null;
            friends = null;
{'fraction_non_alphanumeric': 0.0782411230388109, 'fraction_numerical': 0.00041288191577208916, 'mean_word_length': 2.142023346303502, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6260372', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1158, 'n_words': 470}