Skip to content

Commit

Permalink
fix: bump submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Jun 15, 2024
1 parent a33fcc4 commit 2a5fbab
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 43 deletions.
2 changes: 1 addition & 1 deletion examples/dojo-starter
Submodule dojo-starter updated 0 files
94 changes: 52 additions & 42 deletions examples/react/react-app/src/dojo/generated/contractComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,58 @@

import { defineComponent, Type as RecsType, World } from "@dojoengine/recs";

export type ContractComponents = Awaited<ReturnType<typeof defineContractComponents>>;
export type ContractComponents = Awaited<
ReturnType<typeof defineContractComponents>
>;

export function defineContractComponents(world: World) {
return {
DirectionsAvailable: (() => {
return defineComponent(
world,
{ player: RecsType.BigInt, directions: RecsType.StringArray },
{
metadata: {
name: "DirectionsAvailable",
types: ["contractaddress"],
customTypes: [],
},
}
);
})(),
Moves: (() => {
return defineComponent(
world,
{ player: RecsType.BigInt, remaining: RecsType.Number, last_direction: RecsType.Number, can_move: RecsType.Boolean },
{
metadata: {
name: "Moves",
types: ["contractaddress","u8","enum","bool"],
customTypes: ["Direction"],
},
}
);
})(),
Position: (() => {
return defineComponent(
world,
{ player: RecsType.BigInt, vec: { x: RecsType.Number, y: RecsType.Number } },
{
metadata: {
name: "Position",
types: ["contractaddress","u32","u32"],
customTypes: ["Vec2"],
},
}
);
})(),
};
return {
DirectionsAvailable: (() => {
return defineComponent(
world,
{ player: RecsType.BigInt, directions: RecsType.StringArray },
{
metadata: {
name: "DirectionsAvailable",
types: ["contractaddress"],
customTypes: [],
},
}
);
})(),
Moves: (() => {
return defineComponent(
world,
{
player: RecsType.BigInt,
remaining: RecsType.Number,
last_direction: RecsType.Number,
can_move: RecsType.Boolean,
},
{
metadata: {
name: "Moves",
types: ["contractaddress", "u8", "enum", "bool"],
customTypes: ["Direction"],
},
}
);
})(),
Position: (() => {
return defineComponent(
world,
{
player: RecsType.BigInt,
vec: { x: RecsType.Number, y: RecsType.Number },
},
{
metadata: {
name: "Position",
types: ["contractaddress", "u32", "u32"],
customTypes: ["Vec2"],
},
}
);
})(),
};
}

0 comments on commit 2a5fbab

Please sign in to comment.