-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: u256 and ns for unity bindgen #2635
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,7 @@ | |
using System.Collections.Generic; | ||
using System.Linq; | ||
using Enum = Dojo.Starknet.Enum; | ||
using BigInteger = System.Numerics.BigInteger; | ||
" | ||
.to_string() | ||
} | ||
|
@@ -116,6 +117,7 @@ | |
using System.Linq; | ||
using System.Collections.Generic; | ||
using Enum = Dojo.Starknet.Enum; | ||
using BigInteger = System.Numerics.BigInteger; | ||
" | ||
.to_string() | ||
} | ||
|
@@ -201,23 +203,22 @@ | |
|
||
format!( | ||
" | ||
namespace {namespace} {{ | ||
// Model definition for `{}` model | ||
public class {} : ModelInstance {{ | ||
{} | ||
|
||
// Start is called before the first frame update | ||
void Start() {{ | ||
}} | ||
|
||
// Update is called once per frame | ||
void Update() {{ | ||
}} | ||
// Model definition for `{}` model | ||
public class {}_{} : ModelInstance {{ | ||
{} | ||
|
||
// Start is called before the first frame update | ||
void Start() {{ | ||
}} | ||
|
||
// Update is called once per frame | ||
void Update() {{ | ||
Comment on lines
+206
to
+215
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Ohayo, sensei! Consider using C# namespaces instead of prefixing class names Currently, the model class name includes the namespace appended with an underscore (e.g., public class {}_{} : ModelInstance {{
+// Suggested change:
+namespace {} {{
+ public class {} : ModelInstance {{
{}
}}
+}}
|
||
}} | ||
}} | ||
|
||
", | ||
model.type_path, | ||
namespace, | ||
model.type_name(), | ||
fields | ||
) | ||
|
@@ -343,6 +344,18 @@ | |
true, | ||
enum_variant, | ||
)], | ||
CompositeType::Unknown if t.type_name() == "U256" => vec![ | ||
( | ||
format!("new FieldElement({}.high).Inner", arg_name), | ||
false, | ||
enum_variant.clone(), | ||
), | ||
( | ||
format!("new FieldElement({}.low).Inner", arg_name), | ||
false, | ||
enum_variant, | ||
), | ||
], | ||
CompositeType::Struct => { | ||
let mut tokens = vec![]; | ||
t.inners.iter().for_each(|f| { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.