Skip to content

View with custom state, iteration#12

Merged
kelindar merged 4 commits intomasterfrom
view
Nov 10, 2024
Merged

View with custom state, iteration#12
kelindar merged 4 commits intomasterfrom
view

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
@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