Table of Contents

Interface IGridCalculator

Namespace
MoonBark.GridPlacement.Core.Interfaces
Assembly
MoonBark.GridPlacement.Core.dll

Interface for grid calculation operations.

public interface IGridCalculator

Methods

GetGridSize()

Get grid size

(int width, int height) GetGridSize()

Returns

(int W, int H)

GridToWorld(int, int)

Calculate world position from grid position

(float x, float y) GridToWorld(int gridX, int gridY)

Parameters

gridX int
gridY int

Returns

(float x, float y)

IsInBounds(float, float)

Check if position is within grid bounds

bool IsInBounds(float x, float y)

Parameters

x float
y float

Returns

bool

IsValidGrid(int, int)

Check if grid coordinates are valid

bool IsValidGrid(int x, int y)

Parameters

x int
y int

Returns

bool

SnapToGrid(float, float)

Snap position to grid

(float x, float y) SnapToGrid(float worldX, float worldY)

Parameters

worldX float
worldY float

Returns

(float x, float y)

WorldToGrid(float, float)

Calculate grid position from world position

(int x, int y) WorldToGrid(float worldX, float worldY)

Parameters

worldX float
worldY float

Returns

(int W, int H)