A set of settings that define the properties of a FurnitureType
public struct FurnitureType.TypeSettings : IGenericDataHolder
- Inherited Members
- Extension Methods
TypeSettings(string, Point, ObjectCategory, float, params ColorScheme)
Initializes a new FurnitureType.TypeSettings instance with the given data
public TypeSettings(string name, Point size, ObjectCategory categories, float price, params 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
The color schemes that this furniture type should have. Cannot be empty.
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 BreakableFurniture.BrokenBehavior BrokenBehavior
An array of actions that can modify the passed Furniture instance to allow for multiple variations of it to be displayed as a group in the furniture tool similarly. This is used, for example, for FoodPlate and CustomPainting. If this is null or empty (the former of which it is by default), this furniture item will have no variations.
public Action<Furniture> BuyableVariations
A function that can be used to allow or disallow certain ActionType instances to execute or not. By default, this function is null, meaning no special conditions are created by this FurnitureType, and all actions that themselves are valid can be executed on this furniture item.
public Func<(ActionType Type, ActionInfo Info, bool Automatic, bool IsAuxiliary), CanExecuteResult> CanExecuteAction
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 Type that is constructed when this furniture type is instantiated using Construct<T>(int, Map, Vector2, float, Guid?). The type needs to have a constructor with the same signature as Furniture(Guid, FurnitureType, int, Map, Vector2, float). 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
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, float> 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
The rotation that this furniture type should have when picked from the FurnitureTool. MLEM.Misc.Direction2.Up by default.
public Direction2 DefaultRotation
The name of an overlay texture that should be drawn on top of this object if it is Dirty. Giving this field a value will automatically allow the object to get dirty after a while of being used. The textures loaded through this texture name act similarly to the ones loaded through TextureName, in that they adhere to the object's possible rotations, and have the same amount of layers as ColorMap has entries. By default, the texture to use is "approximated" using GetDefaultDirtyOverlayTextureName(ObjectCategory).
public string DirtyOverlayTextureName
A minimum distance from obstructions (walls and roofs) that this object has to have to be placed. This value is used in GetWallsInTheWay<T>(Vector2, float, Direction2, float, ICollection<WallLike>) and GetRoofingInTheWay(Vector2, int, Direction2, float, ICollection<Roof>) by inflating the object's Size. This value defaults to 0, and it is used by objects like trees.
public int DistanceFromObstructions
This object's efficiency modifier, which is multiplied with a person's efficiency if this object is an involved object in a person's current action. This value is used in GetEfficiencyModifier(Person, ActionInfo, bool, SkillType, float).
public float EfficiencyModifier
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
A function that is used in GetDisplayName to determine the display name that this furniture type's instances should have. Note that, when this function is invoked, the Furniture instance passed may be null.
public Func<string, Furniture, string> GetDisplayName
Whether, when this object is held by a Person, the StandingArmsOut and WalkingArmsOut poses should be used instead of the regular Standing and Walking poses. This looks better for bigger objects like CustomPainting.
public bool HeldArmsOut
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 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
A function that can be used to allow or disallow this object to be slotted into an ObjectSpot on a given Furniture instance. By default, this function is null, meaning no special conditions are created by this FurnitureType, and all object spots that allow this object will be able to accept it.
public Func<(Furniture Parent, ObjectSpot Spot), bool> IsAllowedInSpot
The light settings for an instance of this furniture type. Note that, if this value is set, Construct<T>(int, Map, Vector2, float, Guid?) will automatically construct an instance of LightFurniture, and any custom ConstructedType should extend LightFurniture as well.
public LightFurniture.Settings LightSettings
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
An action that is invoked when the GetDescription(List<string>, bool) method is called on a furniture instance that uses these type settings. This action can be used to add additional description lines, or remove existing ones.
public Action<List<string>, bool> OnDescription
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<T>(int, Map, Vector2, float, Guid?) will construct a BreakableFurniture by default.
public int? Reliability
This object's need restoration modifier, which is multiplied with a person's need restoration speed if this object is an involved object in a person's current action. This value is used in GetRestoreNeedModifier(Person, ActionInfo, bool, NeedType).
public float RestoreNeedModifier
The size, in full tiles, that this furniture should take up
public Point Size
public FurnitureTool.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
public readonly T GetData<T>(string key)
public readonly IEnumerable<string> GetDataKeys()
public void SetData(string key, object data)
public void SetData<T>(string key, T data)