Facepunch.Steamworks/Generator/Cleanup.cs

78 lines
2.7 KiB
C#
Raw Normal View History

2019-04-16 13:45:44 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public static class Cleanup
2019-04-27 16:25:54 +03:00
{
2019-04-16 13:45:44 +03:00
public static string ConvertType( string type )
{
type = type.Replace( "CSteamID", "SteamId" );
type = type.Replace( "CGameID", "GameId" );
2019-04-16 14:17:24 +03:00
type = type.Replace( "PersonaState", "FriendState" );
type = type.Replace( "AudioPlayback_Status", "MusicStatus" );
type = type.Replace( "AuthSessionResponse", "AuthResponse" );
type = type.Replace( "FriendRelationship", "Relationship" );
type = type.Replace( "BeginAuthSessionResult", "BeginAuthResult" );
2019-04-16 18:37:49 +03:00
type = type.Replace( "PublishedFileId_t", "PublishedFileId" );
2019-04-17 10:40:58 +03:00
type = type.Replace( "PublishedFileId_t", "PublishedFileId" );
2019-04-26 16:29:36 +03:00
type = type.Replace( "AppId_t", "AppId" );
2019-04-17 10:40:58 +03:00
type = type.Replace( "LeaderboardSortMethod", "LeaderboardSort" );
type = type.Replace( "LeaderboardDisplayType", "LeaderboardDisplay" );
2019-04-26 15:46:12 +03:00
type = type.Replace( "UGCMatchingUGCType", "UgcType" );
2019-04-29 12:41:40 +03:00
type = type.Replace( "SteamItemInstanceID_t", "InventoryItemId" );
type = type.Replace( "SteamItemDef_t", "InventoryDefId" );
2019-04-16 13:45:44 +03:00
return type;
}
public static bool ShouldCreate( string type )
{
if ( type == "SteamId" ) return false;
2019-04-17 10:40:58 +03:00
if ( type == "LeaderboardSort" ) return false;
if ( type == "LeaderboardDisplay" ) return false;
2019-04-26 16:29:36 +03:00
if ( type == "AppId" ) return false;
2019-04-16 13:45:44 +03:00
return true;
}
2019-04-16 14:17:24 +03:00
internal static string Expose( string name )
{
if ( name == "FriendState" ) return "public";
if ( name == "MusicStatus" ) return "public";
if ( name == "ParentalFeature" ) return "public";
if ( name == "AuthResponse" ) return "public";
if ( name == "Relationship" ) return "public";
if ( name == "BeginAuthResult" ) return "public";
if ( name == "Universe" ) return "public";
if ( name == "NotificationPosition" ) return "public";
if ( name == "GamepadTextInputMode" ) return "public";
if ( name == "GamepadTextInputLineMode" ) return "public";
if ( name == "CheckFileSignature" ) return "public";
if ( name == "BroadcastUploadResult" ) return "public";
2019-04-16 18:37:49 +03:00
if ( name == "PublishedFileId" ) return "public";
if ( name == "Result" ) return "public";
2019-04-26 15:46:12 +03:00
if ( name == "UgcType" ) return "public";
2019-04-29 12:41:40 +03:00
if ( name == "InventoryItemId" ) return "public";
if ( name == "InventoryDefId" ) return "public";
2019-04-16 14:17:24 +03:00
return "internal";
}
2019-04-27 16:25:54 +03:00
internal static bool IsDeprecated( string name )
{
if ( name.StartsWith( "ISteamRemoteStorage." ) )
{
if ( name.Contains( "Publish" ) ) return true;
if ( name.Contains( "ResetFileRequestState" ) ) return true;
if ( name.Contains( "EnumerateUserSubscribedFiles" ) ) return true;
if ( name.Contains( "EnumerateUserSharedWorkshopFile" ) ) return true;
}
return false;
}
2019-04-16 13:45:44 +03:00
}