Table of Contents

Class PlacementData

Namespace
MoonBark.GridPlacement.Core.Data.Placement
Assembly
MoonBark.GridPlacement.Core.dll

Core placement data without Godot dependencies. Contains all information needed for placement calculations.

public class PlacementData
Inheritance
PlacementData
Inherited Members

Properties

BuildingType

Building type/category.

public string BuildingType { get; set; }

Property Value

string

CanFlip

Whether the building can be flipped.

public bool CanFlip { get; set; }

Property Value

bool

CanPlace

Whether the building can be placed.

public bool CanPlace { get; set; }

Property Value

bool

CanRotate

Whether the building can be rotated.

public bool CanRotate { get; set; }

Property Value

bool

DefaultTransparency

Default preview transparency.

public float DefaultTransparency { get; set; }

Property Value

float

Description

Description of the building.

public string Description { get; set; }

Property Value

string

Footprint

Footprint data for the building.

public FootprintData Footprint { get; set; }

Property Value

FootprintData

Id

Unique identifier for the placement.

public string Id { get; set; }

Property Value

string

InvalidColor

Default invalid placement color.

public CoreColor InvalidColor { get; set; }

Property Value

CoreColor

Name

Human-readable name of the placement.

public string Name { get; set; }

Property Value

string

Requirements

Placement requirements.

public PlacementRequirements Requirements { get; set; }

Property Value

PlacementRequirements

ResourceCost

Resource cost for placing the building.

public ResourceCost ResourceCost { get; set; }

Property Value

ResourceCost

ValidColor

Default valid placement color.

public CoreColor ValidColor { get; set; }

Property Value

CoreColor

Methods

GetOccupiedPositions(CoreVector2I, int, bool, bool)

Gets the occupied grid positions for this placement

public List<CoreVector2I> GetOccupiedPositions(CoreVector2I gridPosition, int rotation = 0, bool flipHorizontal = false, bool flipVertical = false)

Parameters

gridPosition CoreVector2I

Placement's grid position

rotation int

Rotation in degrees (0, 90, 180, 270)

flipHorizontal bool

Whether to flip horizontally

flipVertical bool

Whether to flip vertically

Returns

List<CoreVector2I>

List of occupied grid positions