Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c159ae
commit 6c71ce7
Showing
11 changed files
with
978 additions
and
362 deletions.
There are no files selected for viewing
812 changes: 468 additions & 344 deletions
812
generators/Nethereum.Generators.DuoCode/Nethereum.Generators.DuoCode.csproj
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file modified
BIN
+1 KB
(100%)
generators/Nethereum.Generators.DuoCode/scripts/Nethereum.Generators.DuoCode.dll
Binary file not shown.
175 changes: 175 additions & 0 deletions
175
generators/Nethereum.Generators.DuoCode/scripts/Nethereum.Generators.DuoCode.js
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
generators/Nethereum.Generators.DuoCode/scripts/Nethereum.Generators.DuoCode.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
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
34 changes: 34 additions & 0 deletions
34
generators/Nethereum.Generators/Unity/UnityRequestsGenerator.cs
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,34 @@ | ||
using System; | ||
using Nethereum.Generators.Core; | ||
using Nethereum.Generators.CQS; | ||
using Nethereum.Generators.Model; | ||
using Nethereum.Generators.Unity.CSharp; | ||
|
||
namespace Nethereum.Generators.Unity | ||
{ | ||
public class UnityRequestsGenerator : ClassGeneratorBase<ClassTemplateBase<UnityRequestsModel>, UnityRequestsModel> | ||
{ | ||
public ContractABI ContractABI { get; } | ||
|
||
public UnityRequestsGenerator(ContractABI contractABI, string contractName, string byteCode, string @namespace, string cqsNamespace, string functionOutputNamespace, CodeGenLanguage codeGenLanguage) | ||
{ | ||
ContractABI = contractABI; | ||
ClassModel = new UnityRequestsModel(contractABI, contractName, byteCode, @namespace, cqsNamespace, functionOutputNamespace); | ||
ClassModel.CodeGenLanguage = codeGenLanguage; | ||
InitialiseTemplate(codeGenLanguage); | ||
} | ||
|
||
public void InitialiseTemplate(CodeGenLanguage codeGenLanguage) | ||
{ | ||
switch (codeGenLanguage) | ||
{ | ||
case CodeGenLanguage.CSharp: | ||
ClassTemplate = new UnityFunctionRequestsClassTemplates(ClassModel); | ||
break; | ||
default: | ||
throw new ArgumentOutOfRangeException(nameof(codeGenLanguage), codeGenLanguage, "Code generation not implemented for this language"); | ||
} | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.