-
Notifications
You must be signed in to change notification settings - Fork 2
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
ba67877
commit 23af833
Showing
19 changed files
with
19,105 additions
and
23,782 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,145 +1,149 @@ | ||
|
||
// Generated by dojo-bindgen on Wed, 21 Aug 2024 14:15:09 +0000. Do not modify this file manually. | ||
// Import the necessary types from the recs SDK | ||
// generate again with `sozo build --typescript` | ||
// generate again with `sozo build --typescript` | ||
import { defineComponent, Type as RecsType, World } from "@dojoengine/recs"; | ||
|
||
export type ContractComponents = Awaited<ReturnType<typeof defineContractComponents>>; | ||
|
||
|
||
export type ContractComponents = Awaited< | ||
ReturnType<typeof defineContractComponents> | ||
>; | ||
|
||
// Type definition for `dojo::model::layout::Layout` enum | ||
export type Layout = { type: 'Fixed'; value: RecsType.NumberArray; } | { type: 'Struct'; value: RecsType.StringArray; } | { type: 'Tuple'; value: RecsType.StringArray; } | { type: 'Array'; value: RecsType.StringArray; } | { type: 'ByteArray'; } | { type: 'Enum'; value: RecsType.StringArray; }; | ||
export type Layout = | ||
| { type: "Fixed"; value: RecsType.NumberArray } | ||
| { type: "Struct"; value: RecsType.StringArray } | ||
| { type: "Tuple"; value: RecsType.StringArray } | ||
| { type: "Array"; value: RecsType.StringArray } | ||
| { type: "ByteArray" } | ||
| { type: "Enum"; value: RecsType.StringArray }; | ||
|
||
export const LayoutDefinition = { | ||
type: RecsType.String, | ||
value: RecsType.String | ||
type: RecsType.String, | ||
value: RecsType.String, | ||
}; | ||
|
||
// Type definition for `rpg::models::index::Player` struct | ||
export interface Player { | ||
id: BigInt; | ||
mode: Number; | ||
role: Number; | ||
damage: Number; | ||
health: Number; | ||
gold: Number; | ||
score: Number; | ||
seed: BigInt; | ||
name: BigInt; | ||
|
||
id: BigInt; | ||
mode: Number; | ||
role: Number; | ||
damage: Number; | ||
health: Number; | ||
gold: Number; | ||
score: Number; | ||
seed: BigInt; | ||
name: BigInt; | ||
} | ||
export const PlayerDefinition = { | ||
id: RecsType.BigInt, | ||
mode: RecsType.Number, | ||
role: RecsType.Number, | ||
damage: RecsType.Number, | ||
health: RecsType.Number, | ||
gold: RecsType.Number, | ||
score: RecsType.Number, | ||
seed: RecsType.BigInt, | ||
name: RecsType.BigInt, | ||
|
||
id: RecsType.BigInt, | ||
mode: RecsType.Number, | ||
role: RecsType.Number, | ||
damage: RecsType.Number, | ||
health: RecsType.Number, | ||
gold: RecsType.Number, | ||
score: RecsType.Number, | ||
seed: RecsType.BigInt, | ||
name: RecsType.BigInt, | ||
}; | ||
|
||
// Type definition for `dojo::model::layout::FieldLayout` struct | ||
export interface FieldLayout { | ||
selector: BigInt; | ||
layout: Layout; | ||
|
||
selector: BigInt; | ||
layout: Layout; | ||
} | ||
export const FieldLayoutDefinition = { | ||
selector: RecsType.BigInt, | ||
layout: LayoutDefinition, | ||
|
||
selector: RecsType.BigInt, | ||
layout: LayoutDefinition, | ||
}; | ||
|
||
// Type definition for `core::byte_array::ByteArray` struct | ||
export interface ByteArray { | ||
data: String[]; | ||
pending_word: BigInt; | ||
pending_word_len: Number; | ||
|
||
data: String[]; | ||
pending_word: BigInt; | ||
pending_word_len: Number; | ||
} | ||
export const ByteArrayDefinition = { | ||
data: RecsType.StringArray, | ||
pending_word: RecsType.BigInt, | ||
pending_word_len: RecsType.Number, | ||
|
||
data: RecsType.StringArray, | ||
pending_word: RecsType.BigInt, | ||
pending_word_len: RecsType.Number, | ||
}; | ||
|
||
|
||
// Type definition for `rpg::models::index::Dungeon` struct | ||
export interface Dungeon { | ||
id: BigInt; | ||
monster: Number; | ||
role: Number; | ||
damage: Number; | ||
health: Number; | ||
reward: Number; | ||
|
||
id: BigInt; | ||
monster: Number; | ||
role: Number; | ||
damage: Number; | ||
health: Number; | ||
reward: Number; | ||
} | ||
export const DungeonDefinition = { | ||
id: RecsType.BigInt, | ||
monster: RecsType.Number, | ||
role: RecsType.Number, | ||
damage: RecsType.Number, | ||
health: RecsType.Number, | ||
reward: RecsType.Number, | ||
|
||
id: RecsType.BigInt, | ||
monster: RecsType.Number, | ||
role: RecsType.Number, | ||
damage: RecsType.Number, | ||
health: RecsType.Number, | ||
reward: RecsType.Number, | ||
}; | ||
|
||
|
||
export function defineContractComponents(world: World) { | ||
return { | ||
|
||
// Model definition for `rpg::models::index::Player` model | ||
Player: (() => { | ||
return defineComponent( | ||
world, | ||
{ | ||
id: RecsType.BigInt, | ||
mode: RecsType.Number, | ||
role: RecsType.Number, | ||
damage: RecsType.Number, | ||
health: RecsType.Number, | ||
gold: RecsType.Number, | ||
score: RecsType.Number, | ||
seed: RecsType.BigInt, | ||
name: RecsType.BigInt, | ||
}, | ||
{ | ||
metadata: { | ||
namespace: "dojo_starter_rpg", | ||
name: "Player", | ||
types: ["felt252", "u8", "u8", "u8", "u8", "u16", "u16", "felt252", "felt252"], | ||
customTypes: [], | ||
}, | ||
} | ||
); | ||
})(), | ||
return { | ||
// Model definition for `rpg::models::index::Player` model | ||
Player: (() => { | ||
return defineComponent( | ||
world, | ||
{ | ||
id: RecsType.BigInt, | ||
mode: RecsType.Number, | ||
role: RecsType.Number, | ||
damage: RecsType.Number, | ||
health: RecsType.Number, | ||
gold: RecsType.Number, | ||
score: RecsType.Number, | ||
seed: RecsType.BigInt, | ||
name: RecsType.BigInt, | ||
}, | ||
{ | ||
metadata: { | ||
namespace: "dojo_starter_rpg", | ||
name: "Player", | ||
types: [ | ||
"felt252", | ||
"u8", | ||
"u8", | ||
"u8", | ||
"u8", | ||
"u16", | ||
"u16", | ||
"felt252", | ||
"felt252", | ||
], | ||
customTypes: [], | ||
}, | ||
} | ||
); | ||
})(), | ||
|
||
// Model definition for `rpg::models::index::Dungeon` model | ||
Dungeon: (() => { | ||
return defineComponent( | ||
world, | ||
{ | ||
id: RecsType.BigInt, | ||
monster: RecsType.Number, | ||
role: RecsType.Number, | ||
damage: RecsType.Number, | ||
health: RecsType.Number, | ||
reward: RecsType.Number, | ||
}, | ||
{ | ||
metadata: { | ||
namespace: "dojo_starter_rpg", | ||
name: "Dungeon", | ||
types: ["felt252", "u8", "u8", "u8", "u8", "u16"], | ||
customTypes: [], | ||
}, | ||
} | ||
); | ||
})(), | ||
}; | ||
// Model definition for `rpg::models::index::Dungeon` model | ||
Dungeon: (() => { | ||
return defineComponent( | ||
world, | ||
{ | ||
id: RecsType.BigInt, | ||
monster: RecsType.Number, | ||
role: RecsType.Number, | ||
damage: RecsType.Number, | ||
health: RecsType.Number, | ||
reward: RecsType.Number, | ||
}, | ||
{ | ||
metadata: { | ||
namespace: "dojo_starter_rpg", | ||
name: "Dungeon", | ||
types: ["felt252", "u8", "u8", "u8", "u8", "u16"], | ||
customTypes: [], | ||
}, | ||
} | ||
); | ||
})(), | ||
}; | ||
} |
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
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
Oops, something went wrong.