-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented CodeGenerator.
- Loading branch information
Showing
5 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using ReClassNET.CodeGenerator; | ||
using ReClassNET.Nodes; | ||
|
||
namespace FrostbitePlugin | ||
{ | ||
class WeakPtrCodeGenerator : ICustomCodeGenerator | ||
{ | ||
/// <summary>Checks if the language is C++ and the node is a WeakPtrNode.</summary> | ||
/// <param name="node">The node to check.</param> | ||
/// <param name="language">The language to check.</param> | ||
/// <returns>True if we can generate code, false if not.</returns> | ||
public bool CanGenerateCode(BaseNode node, Language language) => language == Language.Cpp && node is WeakPtrNode; | ||
|
||
/// <summary>Gets the member definition of the node.</summary> | ||
/// <param name="node">The member node.</param> | ||
/// <param name="language">The language to generate.</param> | ||
/// <returns>The member definition of the node.</returns> | ||
public MemberDefinition GetMemberDefinition(BaseNode node, Language language) | ||
{ | ||
return new MemberDefinition(node, "fb::WeakPtr"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters