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

Coordinate space translation #132

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Conversation

Chris3606
Copy link
Contributor

@Chris3606 Chris3606 commented Oct 29, 2023

The goal of this PR is to implement a system that can satisfy Chris3606/GoRogue#281. To that end, it makes the following changes:

  • SadRogue.Primitives.UnboundedGridViews namespace has been added
    • Contains interfaces similar to IGridView (and ISettableGridView), except they don't have the constraints of coordinates must start at 0, 0 and have a defined width/height. Basically, these are grid views that can represent an infinite map that uses an arbitrary coordinate space
  • All viewport-related grid views have been moved to their own namespace (SadRogue.Primitives.GridViews.Viewports)
    • Generic IVewport interface now acts as a base interface for all viewport-related implementations
    • The old UnboundedViewport is now called DefaultValueViewport
    • Viewports (UnboundedViewport and UnboundedSettableViewport now exist that expose a sub-area of an IUnboundedGridView as an IGridView; this represents a camera (as an IGridView) of an arbitrary coordinate space
  • Added SadRogue.Primitives.CoordinateSpaceTranslation namespace
    • Provides ways of defining translations between two coordinate spaces
    • Provides an extension method for IViewport which generates a coordinate space translator appropriate for a viewport
    • Provides a grid-view like interface for exposing a grid view of local coordinates as global coordinates

Chris3606 added 10 commits July 20, 2023 10:39
…d/or grids that don't start at (0, 0). Modified UnboundedViewport to be called DefaultValueViewport to avoid confusion (since DefaultValueViewport takes a regular bounded grid view).
…pace translators for viewports. Re-organized namespaces to better reflect current state.
…tion view equivalents for unbounded grid views.
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