Table of Contents

Class CornerFurniture

Tiny Life.dll

A corner furniture is a piece of furniture that has an additional set of corner textures that it can display in various conditions. The default CornerFurniture class can be used for things like hedges, which only have a single vertical and horizontal rotation each. For objects like counters which have four distinct rotations, the subclass CornerFurniture.Counter can be used. For objects with custom connection logic, you can override ShouldConnectTo(Furniture) and GetCornerStatus(Dictionary<Direction2, Direction2>).

public class CornerFurniture : Furniture, IGenericDataHolder
Inherited Members
Extension Methods


CornerFurniture(Guid, FurnitureType, int[], Map, Vector2)

Creates a new furniture instance. By default, this is done using Construct<T>(int[], Map, Vector2, Guid?).

public CornerFurniture(Guid id, FurnitureType type, int[] colors, Map map, Vector2 pos)


id Guid

The id to apply to the created furniture instance

type FurnitureType

The type to create an instance of

colors int[]

The colors to apply to the furniture

map Map

The map to create the furniture on

pos Vector2

The position that the furniture should have


Draw(GameTime, object, Vector2, Vector2, Color?, Direction2, int[], float, bool, ParentInfo, float, bool, List<Item>)

Draws this furniture in the world with the given settings. This is a more generalized version of Draw(GameTime, object, Vector2, Color?, List<Item>)

public override void Draw(GameTime time, object batch, Vector2 pos, Vector2 drawPos, Color? overrideColor, Direction2 rotation, int[] colors, float drawScale, bool pivot, ParentInfo parent, float depthOffset, bool held, List<StaticSpriteBatch.Item> items)


time GameTime

The game time

batch object

The sprite batch to draw with, which is either a Microsoft.Xna.Framework.Graphics.SpriteBatch or MLEM.Graphics.StaticSpriteBatch.

pos Vector2

The position, in world space, that the furniture is at

drawPos Vector2

The position, in draw space, to draw the furniture at

overrideColor Color?

An optional color to override the default colors of the furniture

rotation Direction2

The rotation of the furniture

colors int[]

The colors to draw the furniture with

drawScale float

The scale to draw the furniture with

pivot bool

Whether or not to move the furniture by its texture's pivot point

parent ParentInfo

The object that this furniture is latched on to, or null if there is none

depthOffset float

A value that is added onto the calculated depth of the object

held bool

Whether or not this item is currently being held by a Person

items List<StaticSpriteBatch.Item>

A list of sprite batch items that items should be added to if the batch is a MLEM.Graphics.StaticSpriteBatch.

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 virtual Direction2 GetCornerStatus(Dictionary<Direction2, Direction2> neighborRotations)


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



The direction of the texture that should be used for this corner, or MLEM.Misc.Direction2 for no connection


This method gets called when any neighboring furniture changes in NotifyNeighbors(). The neighboring furniture is passed. By default, this method does nothing, so calling base is not necessary.

protected override void OnNeighborChanged(Furniture neighbor)


neighbor Furniture

The neighbor furniture that changed


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 virtual bool ShouldConnectTo(Furniture neighbor)


neighbor Furniture

The neighbor to connect to



Whether this object should connect to the neighbor furniture


This method is called when this object is loaded from disk. Returning false on this method causes the object to be removed from the map. By default, this method invokes OnValidated and OnEventsAttachable.

public override bool Validate()



false if the object is not valid, true otherwise