Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Dec 31, 2024
1 parent 38bd684 commit dd74d55
Show file tree
Hide file tree
Showing 13 changed files with 213 additions and 96 deletions.
85 changes: 47 additions & 38 deletions Assets/Spawn And Move/Contracts/ns-actions.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@
using Enum = Dojo.Starknet.Enum;

// System definitions for `ns-actions` contract
public class Actions : MonoBehaviour {
public class Actions : MonoBehaviour
{
// The address of this contract
public string contractAddress;


// Call the `spawn` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> spawn(Account account) {
public async Task<FieldElement> spawn(Account account)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();


return await account.ExecuteRaw(new dojo.Call[] {
new dojo.Call{
Expand All @@ -29,12 +31,13 @@ public async Task<FieldElement> spawn(Account account) {
}
});
}





// Call the `move` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> move(Account account, Direction direction) {
public async Task<FieldElement> move(Account account, Direction direction)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(new FieldElement(Enum.GetIndex(direction)).Inner);

Expand All @@ -46,12 +49,13 @@ public async Task<FieldElement> move(Account account, Direction direction) {
}
});
}





// Call the `set_player_config` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> set_player_config(Account account, string name) {
public async Task<FieldElement> set_player_config(Account account, string name)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.AddRange(ByteArray.Serialize(name).Select(f => f.Inner));

Expand All @@ -63,14 +67,15 @@ public async Task<FieldElement> set_player_config(Account account, string name)
}
});
}





// Call the `reset_player_config` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> reset_player_config(Account account) {
public async Task<FieldElement> reset_player_config(Account account)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();


return await account.ExecuteRaw(new dojo.Call[] {
new dojo.Call{
Expand All @@ -80,15 +85,16 @@ public async Task<FieldElement> reset_player_config(Account account) {
}
});
}





// Call the `set_player_server_profile` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> set_player_server_profile(Account account, uint server_id, string name) {
public async Task<FieldElement> set_player_server_profile(Account account, uint server_id, string name)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(new FieldElement(server_id).Inner);
calldata.AddRange(ByteArray.Serialize(name).Select(f => f.Inner));
calldata.AddRange(ByteArray.Serialize(name).Select(f => f.Inner));

return await account.ExecuteRaw(new dojo.Call[] {
new dojo.Call{
Expand All @@ -98,15 +104,16 @@ public async Task<FieldElement> set_player_server_profile(Account account, uint
}
});
}





// Call the `set_models` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> set_models(Account account, FieldElement seed, uint n_models) {
public async Task<FieldElement> set_models(Account account, FieldElement seed, uint n_models)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(seed.Inner);
calldata.Add(new FieldElement(n_models).Inner);
calldata.Add(new FieldElement(n_models).Inner);

return await account.ExecuteRaw(new dojo.Call[] {
new dojo.Call{
Expand All @@ -116,12 +123,13 @@ public async Task<FieldElement> set_models(Account account, FieldElement seed, u
}
});
}





// Call the `enter_dungeon` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> enter_dungeon(Account account, FieldElement dungeon_address) {
public async Task<FieldElement> enter_dungeon(Account account, FieldElement dungeon_address)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(dungeon_address.Inner);

Expand All @@ -133,19 +141,20 @@ public async Task<FieldElement> enter_dungeon(Account account, FieldElement dung
}
});
}





// Call the `set_test` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> set_test(Account account, ns_Test test) {
public async Task<FieldElement> set_test(Account account, ns_Test test)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(new FieldElement(test.ok).Inner);
calldata.Add(new FieldElement(test.x).Inner);
calldata.Add(new FieldElement(test.y).Inner);
calldata.Add(new FieldElement(test.z).Inner);
calldata.Add(new FieldElement(test.a.high).Inner);
calldata.Add(new FieldElement(test.a.low).Inner);
calldata.Add(new FieldElement(test.x).Inner);
calldata.Add(new FieldElement(test.y).Inner);
calldata.Add(new FieldElement(test.z).Inner);
calldata.Add(new FieldElement(test.a.high).Inner);
calldata.Add(new FieldElement(test.a.low).Inner);

return await account.ExecuteRaw(new dojo.Call[] {
new dojo.Call{
Expand All @@ -155,12 +164,13 @@ public async Task<FieldElement> set_test(Account account, ns_Test test) {
}
});
}





// Call the `upgrade` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> upgrade(Account account, FieldElement new_class_hash) {
public async Task<FieldElement> upgrade(Account account, FieldElement new_class_hash)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(new_class_hash.Inner);

Expand All @@ -172,6 +182,5 @@ public async Task<FieldElement> upgrade(Account account, FieldElement new_class_
}
});
}

}

20 changes: 11 additions & 9 deletions Assets/Spawn And Move/Contracts/ns-dungeon.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@
using Enum = Dojo.Starknet.Enum;

// System definitions for `ns-dungeon` contract
public class Dungeon : MonoBehaviour {
public class Dungeon : MonoBehaviour
{
// The address of this contract
public string contractAddress;


// Call the `enter` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> enter(Account account) {
public async Task<FieldElement> enter(Account account)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();


return await account.ExecuteRaw(new dojo.Call[] {
new dojo.Call{
Expand All @@ -29,12 +31,13 @@ public async Task<FieldElement> enter(Account account) {
}
});
}





// Call the `upgrade` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> upgrade(Account account, FieldElement new_class_hash) {
public async Task<FieldElement> upgrade(Account account, FieldElement new_class_hash)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(new_class_hash.Inner);

Expand All @@ -46,6 +49,5 @@ public async Task<FieldElement> upgrade(Account account, FieldElement new_class_
}
});
}

}

11 changes: 6 additions & 5 deletions Assets/Spawn And Move/Contracts/ns-mock_token.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
using Enum = Dojo.Starknet.Enum;

// System definitions for `ns-mock_token` contract
public class Mock_token : MonoBehaviour {
public class Mock_token : MonoBehaviour
{
// The address of this contract
public string contractAddress;


// Call the `upgrade` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> upgrade(Account account, FieldElement new_class_hash) {
public async Task<FieldElement> upgrade(Account account, FieldElement new_class_hash)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(new_class_hash.Inner);

Expand All @@ -29,6 +31,5 @@ public async Task<FieldElement> upgrade(Account account, FieldElement new_class_
}
});
}

}

11 changes: 6 additions & 5 deletions Assets/Spawn And Move/Contracts/ns-others.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
using Enum = Dojo.Starknet.Enum;

// System definitions for `ns-others` contract
public class Others : MonoBehaviour {
public class Others : MonoBehaviour
{
// The address of this contract
public string contractAddress;


// Call the `upgrade` system with the specified Account and calldata
// Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be confirmed.
public async Task<FieldElement> upgrade(Account account, FieldElement new_class_hash) {
public async Task<FieldElement> upgrade(Account account, FieldElement new_class_hash)
{
List<dojo.FieldElement> calldata = new List<dojo.FieldElement>();
calldata.Add(new_class_hash.Inner);

Expand All @@ -29,6 +31,5 @@ public async Task<FieldElement> upgrade(Account account, FieldElement new_class_
}
});
}

}

13 changes: 8 additions & 5 deletions Assets/Spawn And Move/Models/ns-Message.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
using Enum = Dojo.Starknet.Enum;

// Type definition for `core::option::Option::<core::integer::u32>` enum
public abstract record Option<A>() : Enum {
public abstract record Option<A>() : Enum
{
public record Some(A value) : Option<A>;
public record None() : Option<A>;
}

// Model definition for `dojo_examples::models::Message` model
public class ns_Message : ModelInstance {
public class ns_Message : ModelInstance
{
[ModelField("identity")]
public FieldElement identity;

Expand All @@ -28,12 +30,13 @@ public class ns_Message : ModelInstance {
public FieldElement salt;

// Start is called before the first frame update
void Start() {
void Start()
{
}

// Update is called once per frame
void Update() {
void Update()
{
}
}


10 changes: 6 additions & 4 deletions Assets/Spawn And Move/Models/ns-MockToken.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@
using BigInteger = System.Numerics.BigInteger;

// Model definition for `dojo_examples::models::MockToken` model
public class ns_MockToken : ModelInstance {
public class ns_MockToken : ModelInstance
{
[ModelField("account")]
public FieldElement account;

[ModelField("amount")]
public BigInteger amount;

// Start is called before the first frame update
void Start() {
void Start()
{
}

// Update is called once per frame
void Update() {
void Update()
{
}
}


10 changes: 6 additions & 4 deletions Assets/Spawn And Move/Models/ns-Moved.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
using Enum = Dojo.Starknet.Enum;

// Model definition for `dojo_examples::models::Moved` model
public class ns_Moved : ModelInstance {
public class ns_Moved : ModelInstance
{
[ModelField("player")]
public FieldElement player;

[ModelField("direction")]
public Direction direction;

// Start is called before the first frame update
void Start() {
void Start()
{
}

// Update is called once per frame
void Update() {
void Update()
{
}
}


Loading

0 comments on commit dd74d55

Please sign in to comment.