mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-03-29 05:39:06 +03:00
Deduplicate function names
This commit is contained in:
parent
5782160623
commit
b6f651b45c
@ -46,6 +46,29 @@ namespace Generator
|
|||||||
|
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PostProcess()
|
||||||
|
{
|
||||||
|
var LastName = "";
|
||||||
|
var DuplicateCount = 0;
|
||||||
|
|
||||||
|
for (int i=0; i< Functions.Count; i++ )
|
||||||
|
{
|
||||||
|
var ThisName = Functions[i].Name;
|
||||||
|
|
||||||
|
if ( Functions[i].Name == LastName)
|
||||||
|
{
|
||||||
|
DuplicateCount++;
|
||||||
|
Functions[i].Name += $"{DuplicateCount + 1}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DuplicateCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
LastName = ThisName;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ namespace Generator
|
|||||||
if ( line.Trim().StartsWith( "public:" ) ) continue;
|
if ( line.Trim().StartsWith( "public:" ) ) continue;
|
||||||
if ( line.Trim().StartsWith( "//" ) ) continue;
|
if ( line.Trim().StartsWith( "//" ) ) continue;
|
||||||
|
|
||||||
var callresult = Regex.Match( line, @"STEAM_CALL_RESULT\( (.+?) \)" );
|
var callresult = Regex.Match( line, @"STEAM_CALL_RESULT\((.+?)\)" );
|
||||||
if ( callresult.Success )
|
if ( callresult.Success )
|
||||||
{
|
{
|
||||||
lastCallResult = callresult.Groups[1].Value.Trim();
|
lastCallResult = callresult.Groups[1].Value.Trim();
|
||||||
@ -89,6 +89,7 @@ namespace Generator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.PostProcess();
|
||||||
|
|
||||||
Classes.Add( c );
|
Classes.Add( c );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user