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

[example] Array example using a grid #74

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

VietnameseRick
Copy link

@VietnameseRick VietnameseRick commented Jun 12, 2024

#69

Checklist

  • Create a 10x10 grid
  • Allow players to move from one hex to another.
  • Store the players in an Array
  • Create impl to check if a player is in the Array on the location

@VietnameseRick
Copy link
Author

I will write test for grid example in the near time

fn is_neighbor(self: GridTile, other: GridTile) -> bool;
fn tiles_within_range(self: GridTile, range: u32) -> Array<GridTile>;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

can use:

#[generate_trait]

to make code cleaner

@@ -0,0 +1,2 @@
## Grid map using Array

Copy link
Contributor

Choose a reason for hiding this comment

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

add a brief explanation in the readme

Copy link
Contributor

@ponderingdemocritus ponderingdemocritus left a comment

Choose a reason for hiding this comment

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

Great start - added some comments. Could you also add some comments within the code explaining the array section.

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