structs can have embedded enums

This commit is contained in:
Garry Newman 2020-02-19 09:00:23 +00:00
parent 4cd8675356
commit 0a43db11ec
4 changed files with 21 additions and 3 deletions

View File

@ -54,7 +54,7 @@ public static class Cleanup
type = type.Replace( "ISteamNetworkingMessage", "NetMsg" );
type = type.Replace( "SteamNetworkingMessage_t", "NetMsg" );
type = type.Replace( "RequestPlayersForGameResultCallback_t_PlayerAcceptState_t", "PlayerAcceptState_t" );
type = type.Replace( "::", "." );
return type;
}

View File

@ -67,6 +67,14 @@ namespace Generator
StructFields( c.Fields );
WriteLine();
if ( c.Enums != null )
{
foreach ( var e in c.Enums )
{
WriteEnum( e, e.Name );
}
}
}
EndBlock();
WriteLine();

View File

@ -89,8 +89,16 @@ namespace Generator
WriteLine( "#endregion" );
}
// if ( c.CallbackId ) )
{
if ( c.Enums != null )
{
foreach ( var e in c.Enums )
{
WriteEnum( e, e.Name );
}
}
// if ( c.CallbackId ) )
{
callbackList.Add( c );
}

View File

@ -101,6 +101,8 @@ namespace Generator
}
}
public EnumDef[] Enums { get; set; }
}
public List<StructDef> structs { get; set; }