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
IsVisible
Gets or sets whether the preview should be visible.
public bool IsVisible { get; set; }
Property Value
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
ValidationStatus
Gets or sets the validation status code.
public int ValidationStatus { get; set; }
Property Value
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
transformCoreVector3The transform for the preview.
occupiedCellsList<CoreVector2I>The cells that will be occupied.
isValidboolWhether the placement is valid.
validationStatusintThe validation status code.
validationMessagestringThe validation message.
Returns
- PreviewModel
A new PreviewModel instance.