A set of settings that define the properties of a FurnitureType
public struct FurnitureType.TypeSettings : MLEM.Misc.IGenericDataHolder
Initializes a new TypeSettings instance with the given data
public TypeSettings(string name, Microsoft.Xna.Framework.Point size, TinyLife.Objects.ObjectCategory categories, float price, params TinyLife.Utilities.ColorScheme colorSchemes);
The name that this furniture type should have
The size that this furniture type should have
The categories that this furniture type should have
The price of this furniture type
An array of ActionSpot instances that this furniture type should have.
By default, every tile that this furniture covers has an action spot reachable from all sides.
public ActionSpot ActionSpots;
public BrokenBehavior BrokenBehavior;
An array of actions that can modify the passed Furniture instance.
If this is set, additional variations of this furniture type will show up in the FurnitureTool, and buying them will invoke this action that can then modify the furniture type.
This is used, for example, for TinyLife.Objects.FurnitureType.FoodPlate and TinyLife.Objects.FurnitureType.CustomPainting.
public Action<Furniture> BuyableVariations;
A set of ObjectCategory flags that this furniture should have
public ObjectCategory Categories;
An array of indices that determines which layers should use which color schemes.
A furniture will always have the same amount of layers as there are color map entries.
public int ColorMap;
An array of color schemes that this furniture type should have.
If ColorMap is not set, its value is determined automatically by the amount of color schemes supplied.
public ColorScheme ColorSchemes;
A delegate to a System.Type that is constructed when this furniture type is instantiated using Construct(int, Map, Vector2, Nullable<Guid>).
The type needs to have a constructor with the same signature as Furniture(Guid, FurnitureType, int, Map, Vector2).
If this value is null, a Furniture instance will be constructed from this type if its Reliability is null, or a BreakableFurniture instance if it is non-null.
public Type ConstructedType;
The lights that should be created for an instance of this furniture type.
Note that, if this value is set, Construct(int, Map, Vector2, Nullable<Guid>) will automatically construct an instance of LightFurniture, and any custom ConstructedType should extend LightFurniture as well.
public Func<LightFurniture,Light> CreateLights;
A function that returns an integer for a given Furniture instance of this type.
The integer represents the decoration (or prettiness) rating of the object. The rating determines some EmotionModifier values.
A negative return value makes the object be perceived as ugly, whereas a positive rating makes the object be perceived as pretty.
By default, this function returns 0.
public Func<Furniture,int> DecorativeRating;
The default color selection for this furniture type.
If not specified, this defaults to the first entries in each of the ColorSchemes.
public int DefaultColors;
public Direction2 DefaultRotation;
This object's electricity rating. A higher electricity rating means the bills for the lot this object is on will be higher.
The electricity rating is also displayed in the furniture tool menu.
public float ElectricityRating;
Whether, when this object is held by a Person, its textures should maintain their defined pivot points.
If this value is false, the item is centered, meaning that its center is in the person's hand.
public bool HeldPivot;
The scale that this furniture should be drawn with when held by a Person
public float HeldScale;
The build mode icon for this object, which represents the category / theme / mod that it comes from.
If this value is nonnull, the icon will be displayed in the corner of the build mode button for this object.
public TextureRegion Icon;
The name of the furniture type. Should be unique across all game content, including all mods.
public string Name;
An array of ObjectSpot instances that this furniture type should have.
By default, there are no object spots.
public ObjectSpot ObjectSpots;
The price that this furniture should have
public float Price;
The reliability of this furniture item, which should be a value between 1 and 10.
This value defaults to null, menaing this object is non-breakable.
Note that, if this value is non-null, Construct(int, Map, Vector2, Nullable<Guid>) will construct a BreakableFurniture by default.
public Nullable<int> Reliability;
The size, in full tiles, that this furniture should take up
public Point Size;
public Tab Tab;
The name of the base texture that this furniture type should use.
If this is not explicitly set, it defaults to this furniture type's Name.
public string TextureName;
The visibility settings for this furniture type.
The visibility determines whether this object gets culled if the camera is far away, etc.
This value defaults to WhenVisible.
public Visibility Visibility;
This object's water consumption rating. A higher water consumption rating means the bills for the lot this object is on will be higher.
The water consumption rating is also displayed in the furniture tool menu.
public float WaterRating;
Returns a piece of generic data of the given type on this object.
public T GetData<T>(string key);
The type of the data stored
The key that the data is stored by
The data, or default if it doesn't exist
Returns all of the generic data that this object stores.
public System.Collections.Generic.IReadOnlyCollection<string> GetDataKeys();
Store a piece of generic data on this object.
public void SetData(string key, object data);
The key to store the data by
The data to store in the object
Implements SetData(string, object)