Class CornerFurniture.Counter
A counter is a CornerFurniture that can have four distinct rotations. A corner is only created for a counter if the two neighboring furnitures both face toward the same tile.
public class CornerFurniture.Counter : CornerFurniture, IGenericDataHolder
- Inheritance
-
JsonTypeSafeGenericDataHolderCornerFurniture.Counter
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
Counter(Guid, FurnitureType, int[], Map, Vector2, float)
Creates a new furniture instance. By default, this is done using Construct<T>(int[], Map, Vector2, float, Guid?).
public Counter(Guid id, FurnitureType type, int[] colors, Map map, Vector2 pos, float floor)
Parameters
id
GuidThe id to apply to the created furniture instance
type
FurnitureTypeThe type to create an instance of
colors
int[]The colors to apply to the furniture
map
MapThe map to create the furniture on
pos
Vector2The position that the furniture should have
floor
floatThe floor that this object is on.
Methods
GetCornerStatus(Dictionary<Direction2, Direction2>)
A method that is used to determine the corner status that this furniture should have, based on the given neighborRotations
.
The neighbor rotations are previously gathered based on the information returned for each neighbor in ShouldConnectTo(Furniture).
protected override Direction2 GetCornerStatus(Dictionary<Direction2, Direction2> neighborRotations)
Parameters
neighborRotations
Dictionary<Direction2, Direction2>The rotations of each neighbor, where the keys are the direction that the neighbor is in, and the values are the neighbor's Rotation
Returns
- Direction2
The direction of the texture that should be used for this corner, or MLEM.Maths.Direction2 for no connection
ShouldConnectTo(Furniture)
A method that determines whether this corner furniture should connect to the given neighboring furniture. If this method returns true, the neighbor's rotation is passed to GetCornerStatus(Dictionary<Direction2, Direction2>).
protected override bool ShouldConnectTo(Furniture neighbor)
Parameters
neighbor
FurnitureThe neighbor to connect to
Returns
- bool
Whether this object should connect to the neighbor furniture