Skip to content
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

feat: improve direction type + add check on 'can_move' #98

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

MartianGreed
Copy link
Contributor

No description provided.

src/models.cairo Outdated
@@ -1,12 +1,13 @@
use starknet::ContractAddress;
use starknet::{ContractAddress};
use core::option::Option;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option is not into the prelude? If not, let's try to update the edition to see if we can avoid to import that.

@@ -48,7 +48,7 @@ pub mod actions {

// 2. Set the player's remaining moves to 100.
let moves = Moves {
player, remaining: 100, last_direction: Direction::None(()), can_move: true
player, remaining: 100, last_direction: core::Option::None, can_move: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
player, remaining: 100, last_direction: core::Option::None, can_move: true
player, remaining: 100, last_direction: Option::None, can_move: true

would be great to avoid having to import core this way is possible.

@glihm
Copy link
Contributor

glihm commented Jan 5, 2025

Wondering if generally speaking we should revamp this example as we discussed to map to a front-end game with all the different part of the stack used: models, events, historical events, etc..

@glihm glihm merged commit cbd43d5 into dojoengine:main Jan 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants