From 23af83302c91dfe4e97a1324a9e05e8a0bcdfa92 Mon Sep 17 00:00:00 2001 From: ponderingdemocritus Date: Mon, 26 Aug 2024 19:46:32 -0400 Subject: [PATCH] fix dungeon and bump versions --- .../react-client/src/typescript/models.gen.ts | 222 +- clients/react-recs-app/src/App.tsx | 11 +- .../src/dojo/createSystemCalls.ts | 14 +- .../src/dojo/typescript/models.gen.ts | 4 +- contracts/README.md | 2 +- ...jo_starter_rpg-BigBrainModel-16c5dbb4.json | 407 - contracts/manifests/dev/base/dojo-world.toml | 4 +- ...jo_starter_rpg-BigBrainModel-16c5dbb4.toml | 16 - .../dojo_starter_rpg-Dungeon-437fd4ba.toml | 1 + .../dojo_starter_rpg-Player-12268099.toml | 1 + ...jo_starter_rpg-BigBrainModel-16c5dbb4.json | 407 - .../manifests/dev/deployment/manifest.json | 14 +- .../manifests/dev/deployment/manifest.toml | 14 +- contracts/target/dev/dojo-world.json | 37657 ++++++++-------- ...o_starter_rpg-BigBrainModel-16c5dbb4.cairo | 454 - ...jo_starter_rpg-BigBrainModel-16c5dbb4.json | 3391 -- .../dojo_starter_rpg-Dungeon-437fd4ba.cairo | 60 + .../dojo_starter_rpg-Player-12268099.cairo | 60 + pnpm-lock.yaml | 148 +- 19 files changed, 19105 insertions(+), 23782 deletions(-) delete mode 100644 contracts/manifests/dev/base/abis/models/dojo_starter_rpg-BigBrainModel-16c5dbb4.json delete mode 100644 contracts/manifests/dev/base/models/dojo_starter_rpg-BigBrainModel-16c5dbb4.toml delete mode 100644 contracts/manifests/dev/deployment/abis/models/dojo_starter_rpg-BigBrainModel-16c5dbb4.json delete mode 100644 contracts/target/dev/models/dojo_starter_rpg-BigBrainModel-16c5dbb4.cairo delete mode 100644 contracts/target/dev/models/dojo_starter_rpg-BigBrainModel-16c5dbb4.json diff --git a/clients/react-client/src/typescript/models.gen.ts b/clients/react-client/src/typescript/models.gen.ts index 55eed71..1d56ed3 100644 --- a/clients/react-client/src/typescript/models.gen.ts +++ b/clients/react-client/src/typescript/models.gen.ts @@ -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>; - - +export type ContractComponents = Awaited< + ReturnType +>; // 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: [], + }, + } + ); + })(), + }; } diff --git a/clients/react-recs-app/src/App.tsx b/clients/react-recs-app/src/App.tsx index fb0a31f..16ef200 100644 --- a/clients/react-recs-app/src/App.tsx +++ b/clients/react-recs-app/src/App.tsx @@ -21,6 +21,9 @@ function App() { const player = useComponentValue(Player, entityId); const dungeon = useComponentValue(Dungeon, entityId); + console.log("dungeon", dungeon); + console.log("player", player); + return ( <>
@@ -42,7 +45,7 @@ function App() {