Skip to content

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.
public Point CurrentOffset { get; private set; }

/// <summary>
/// Creates a new instance of <see cref="OffsetBasedCoordinateSpaceTranslator"/> with the given
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bad copy/paste comment

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