8000 View with custom state, iteration by kelindar · Pull Request #12 · kelindar/tile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

View with custom state, iteration #12

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

Merged
merged 4 commits into from
Nov 10, 2024
Merged

View with custom state, iteration #12

merged 4 commits into from
Nov 10, 2024

Conversation

kelindar
Copy link
Owner

This pull request introduces significant changes to the Grid and View functionality, including the introduction of a new Observer interface and the refactoring of the View structure to support state and type parameters. The most important changes are outlined below:

Refactoring and New Functionality:

  • view.go: Introduced a new Observer interface and refactored the View structure to support state and type parameters. The NewView function now creates a view with a given state, and the Resize, MoveTo, MoveBy, MoveAt, Each, At, WriteAt, MergeAt, and Close methods have been updated to use the new structure. [1] [2] [3] [4] [5] [6] [7]

Observer Handling:

  • grid.go: Removed the View method from the Grid structure and added the Observers method to the Tile structure to iterate over all views observing a tile. [1] [2]

Utility Functions:

  • point.go: Added pack and unpackRect methods to the Rect structure for packing and unpacking rectangle representations.

Documentation Update:

  • README.md: Updated the documentation to reflect the changes from View to NewView and provided additional information on the type parameters for the NewView function.

@kelindar kelindar merged commit f08fc79 into master Nov 10, 2024
3 checks passed
@kelindar kelindar deleted the view branch November 10, 2024 10:17
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.

1 participant
0