Table of Contents

Class PreviewModel

Namespace
MoonBark.GridPlacement.Core.Types
Assembly
MoonBark.GridPlacement.Core.dll

Represents a preview model for placement operations.

This class contains the visual and spatial data needed to render a preview of where a placeable object will be placed.

public class PreviewModel
Inheritance
PreviewModel
Inherited Members

Constructors

PreviewModel()

Initializes a new instance of the PreviewModel class.

public PreviewModel()

Properties

IsValidPlacement

Gets or sets whether the placement is valid.

public bool IsValidPlacement { get; set; }

Property Value

bool

IsVisible

Gets or sets whether the preview should be visible.

public bool IsVisible { get; set; }

Property Value

bool

OccupiedCells

Gets or sets the list of grid cells that will be occupied.

public List<CoreVector2I> OccupiedCells { get; set; }

Property Value

List<CoreVector2I>

Transform

Gets or sets the transform for the preview.

public CoreVector3 Transform { get; set; }

Property Value

CoreVector3

ValidationMessage

Gets or sets the validation message.

public string ValidationMessage { get; set; }

Property Value

string

ValidationStatus

Gets or sets the validation status code.

public int ValidationStatus { get; set; }

Property Value

int

Methods

Hidden()

Creates a hidden preview model.

public static PreviewModel Hidden()

Returns

PreviewModel

A new hidden PreviewModel instance.

Visible(CoreVector3, List<CoreVector2I>?, bool, int, string)

Creates a visible preview model with the specified transform and cells.

public static PreviewModel Visible(CoreVector3 transform, List<CoreVector2I>? occupiedCells, bool isValid = true, int validationStatus = 1, string validationMessage = "")

Parameters

transform CoreVector3

The transform for the preview.

occupiedCells List<CoreVector2I>

The cells that will be occupied.

isValid bool

Whether the placement is valid.

validationStatus int

The validation status code.

validationMessage string

The validation message.

Returns

PreviewModel

A new PreviewModel instance.