Facepunch.Steamworks/Generator/CodeWriter/Constants.cs

28 lines
724 B
C#
Raw Normal View History

2016-10-29 22:28:16 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Generator
{
public partial class CodeWriter
{
2016-10-29 23:05:48 +03:00
private void Constants()
2016-10-29 22:28:16 +03:00
{
2016-11-02 23:22:11 +03:00
StartBlock( "internal static class CallbackIdentifiers" );
2016-10-29 23:05:48 +03:00
foreach ( var o in def.CallbackIds )
2016-10-29 22:28:16 +03:00
{
2016-10-29 23:05:48 +03:00
WriteLine( $"public const int {o.Key} = {o.Value};" );
}
EndBlock();
2016-10-29 22:28:16 +03:00
2016-11-02 23:22:11 +03:00
StartBlock( "internal static class Defines" );
2016-10-29 23:05:48 +03:00
foreach ( var o in def.Defines )
{
2016-11-02 23:22:11 +03:00
WriteLine( $"internal const string {o.Key} = \"{o.Value}\";" );
2016-10-29 22:28:16 +03:00
}
2016-10-29 23:05:48 +03:00
EndBlock();
2016-10-29 22:28:16 +03:00
}
}
2016-10-29 23:05:48 +03:00
}