Class FurnitureType
A furniture type is basically a blueprint for Furniture objects.
Each furniture type can create a furniture instance and the type's data will be transferred to the instance.
Furniture types are automatically listed in the FurnitureTool if registered using Register(FurnitureType.TypeSettings).
Inheritance
System.Object
MLEM.Misc.GenericDataHolder
FurnitureType
Implements
MLEM.Misc.IGenericDataHolder
Inherited Members
MLEM.Misc.GenericDataHolder.SetData(System.String, System.Object)
MLEM.Misc.GenericDataHolder.GetData<T>(System.String)
MLEM.Misc.GenericDataHolder.GetDataKeys()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Tiny Life.dll
Syntax
[JsonConverter(typeof(StaticJsonConverter<FurnitureType>), new object[]{typeof(FurnitureType), "PrivateTypes"})]
public class FurnitureType : GenericDataHolder, IGenericDataHolder, IPricedObject, IEmotionSource
Fields
BaristaCoffeeMachine
Declaration
public static readonly FurnitureType BaristaCoffeeMachine
Field Value
BirchTree
Declaration
public static readonly FurnitureType BirchTree
Field Value
Book
Declaration
public static readonly FurnitureType Book
Field Value
BulbFairyLights
Declaration
public static readonly FurnitureType BulbFairyLights
Field Value
CafeDisplayCase
Declaration
public static readonly FurnitureType CafeDisplayCase
Field Value
CafeSign
Declaration
public static readonly FurnitureType CafeSign
Field Value
ChildStove
Declaration
public static readonly FurnitureType ChildStove
Field Value
ColorfulCandles
Declaration
public static readonly FurnitureType ColorfulCandles
Field Value
CountryFence
Declaration
public static readonly FurnitureType CountryFence
Field Value
CushionedWoodworkingSofa
Declaration
public static readonly FurnitureType CushionedWoodworkingSofa
Field Value
CustomPainting
Declaration
public static readonly FurnitureType CustomPainting
Field Value
Cypress
Declaration
public static readonly FurnitureType Cypress
Field Value
DecorativeKite
Declaration
public static readonly FurnitureType DecorativeKite
Field Value
DecorativeLogPile
Declaration
public static readonly FurnitureType DecorativeLogPile
Field Value
DirtyTextures
Declaration
public readonly IDictionary<Direction2, TextureRegion[]> DirtyTextures
Field Value
Type |
Description |
System.Collections.Generic.IDictionary<MLEM.Misc.Direction2, MLEM.Textures.TextureRegion[]> |
|
Doormat
Declaration
public static readonly FurnitureType Doormat
Field Value
Dumbbell
Declaration
public static readonly FurnitureType Dumbbell
Field Value
DumbbellRack
Declaration
public static readonly FurnitureType DumbbellRack
Field Value
EdisonWoodworkingLamp
Declaration
public static readonly FurnitureType EdisonWoodworkingLamp
Field Value
EmptyGlass
Declaration
public static readonly FurnitureType EmptyGlass
Field Value
EmptyMug
Declaration
public static readonly FurnitureType EmptyMug
Field Value
EmptyPlate
Declaration
public static readonly FurnitureType EmptyPlate
Field Value
EmptyPlatter
Declaration
public static readonly FurnitureType EmptyPlatter
Field Value
EvergreenTree
Declaration
public static readonly FurnitureType EvergreenTree
Field Value
FoodGlass
Declaration
public static readonly FurnitureType FoodGlass
Field Value
FoodMug
Declaration
public static readonly FurnitureType FoodMug
Field Value
FoodPlate
Declaration
public static readonly FurnitureType FoodPlate
Field Value
FoodPlatter
Declaration
public static readonly FurnitureType FoodPlatter
Field Value
FourPostBed
Declaration
public static readonly FurnitureType FourPostBed
Field Value
FullyCushionedWoodworkingSofa
Declaration
public static readonly FurnitureType FullyCushionedWoodworkingSofa
Field Value
GlassDinnerTable
Declaration
public static readonly FurnitureType GlassDinnerTable
Field Value
GlassPenCup
Declaration
public static readonly FurnitureType GlassPenCup
Field Value
GlassSingleTable
Declaration
public static readonly FurnitureType GlassSingleTable
Field Value
GrassPatch
Declaration
public static readonly FurnitureType GrassPatch
Field Value
Gravestone
Declaration
public static readonly FurnitureType Gravestone
Field Value
GrillingFood
Declaration
public static readonly FurnitureType GrillingFood
Field Value
Hedge
Declaration
public static readonly FurnitureType Hedge
Field Value
HomeworkBook
Declaration
public static readonly FurnitureType HomeworkBook
Field Value
HugeRectangleRug
Declaration
public static readonly FurnitureType HugeRectangleRug
Field Value
LargePotPlant
Declaration
public static readonly FurnitureType[] LargePotPlant
Field Value
LargeRectangleRug
Declaration
public static readonly FurnitureType LargeRectangleRug
Field Value
LargeRoundRug
Declaration
public static readonly FurnitureType LargeRoundRug
Field Value
LargeWoodworkingSofa
Declaration
public static readonly FurnitureType LargeWoodworkingSofa
Field Value
LgbtFlags
Declaration
public static readonly FurnitureType[] LgbtFlags
Field Value
LongDinnerTable
Declaration
public static readonly FurnitureType LongDinnerTable
Field Value
Mailbox
Declaration
public static readonly FurnitureType Mailbox
Field Value
MapleTree
Declaration
public static readonly FurnitureType MapleTree
Field Value
MixologyKit
Declaration
public static readonly FurnitureType MixologyKit
Field Value
ModernBed
Declaration
public static readonly FurnitureType ModernBed
Field Value
ModernBedsideLamp
Declaration
public static readonly FurnitureType ModernBedsideLamp
Field Value
ModernChair
Declaration
public static readonly FurnitureType ModernChair
Field Value
ModernComputer
Declaration
public static readonly FurnitureType ModernComputer
Field Value
ModernFridge
Declaration
public static readonly FurnitureType ModernFridge
Field Value
ModernSingleBed
Declaration
public static readonly FurnitureType ModernSingleBed
Field Value
ModernSink
Declaration
public static readonly FurnitureType ModernSink
Field Value
ModernStove
Declaration
public static readonly FurnitureType ModernStove
Field Value
ModernTv
Declaration
public static readonly FurnitureType ModernTv
Field Value
ModernTvStand
Declaration
public static readonly FurnitureType ModernTvStand
Field Value
ModernWoodworkingLamp
Declaration
public static readonly FurnitureType ModernWoodworkingLamp
Field Value
Mop
Declaration
public static readonly FurnitureType Mop
Field Value
Newspaper
Declaration
public static readonly FurnitureType Newspaper
Field Value
OakTree
Declaration
public static readonly FurnitureType OakTree
Field Value
OldComputer
Declaration
public static readonly FurnitureType OldComputer
Field Value
OrnateBed
Declaration
public static readonly FurnitureType OrnateBed
Field Value
OrnateFlowerBed
Declaration
public static readonly FurnitureType OrnateFlowerBed
Field Value
OrnateSingleBed
Declaration
public static readonly FurnitureType OrnateSingleBed
Field Value
PaintBrush
Declaration
public static readonly FurnitureType PaintBrush
Field Value
PaperPendantLight
Declaration
public static readonly FurnitureType PaperPendantLight
Field Value
ParkTrashCan
Declaration
public static readonly FurnitureType ParkTrashCan
Field Value
PlainCoffeeTable
Declaration
public static readonly FurnitureType PlainCoffeeTable
Field Value
Pot
Declaration
public static readonly FurnitureType Pot
Field Value
PotPlant
Declaration
public static readonly FurnitureType PotPlant
Field Value
PreparedFood
Declaration
public static readonly FurnitureType PreparedFood
Field Value
ProteinShakeKit
Declaration
public static readonly FurnitureType ProteinShakeKit
Field Value
Puddle
Declaration
public static readonly FurnitureType Puddle
Field Value
Puzzle
Declaration
public static readonly FurnitureType Puzzle
Field Value
Sandbox
Declaration
public static readonly FurnitureType Sandbox
Field Value
Settings
This furniture type's settings
Declaration
public readonly FurnitureType.TypeSettings Settings
Field Value
SimpleBar
Declaration
public static readonly FurnitureType SimpleBar
Field Value
SimpleBench
Declaration
public static readonly FurnitureType SimpleBench
Field Value
SimpleBookshelf
Declaration
public static readonly FurnitureType SimpleBookshelf
Field Value
SimpleCeilingLamp
Declaration
public static readonly FurnitureType SimpleCeilingLamp
Field Value
SimpleChair
Declaration
public static readonly FurnitureType SimpleChair
Field Value
SimpleCounter
Declaration
public static readonly FurnitureType SimpleCounter
Field Value
SimpleDesk
Declaration
public static readonly FurnitureType SimpleDesk
Field Value
SimpleDrawer
Declaration
public static readonly FurnitureType SimpleDrawer
Field Value
SimpleEasel
Declaration
public static readonly FurnitureType SimpleEasel
Field Value
SimpleLamp
Declaration
public static readonly FurnitureType SimpleLamp
Field Value
SimpleLowTable
Declaration
public static readonly FurnitureType SimpleLowTable
Field Value
SimpleOpenShower
Declaration
public static readonly FurnitureType SimpleOpenShower
Field Value
SimplePicnicTable
Declaration
public static readonly FurnitureType SimplePicnicTable
Field Value
SimpleShower
Declaration
public static readonly FurnitureType SimpleShower
Field Value
SimpleSofa
Declaration
public static readonly FurnitureType SimpleSofa
Field Value
SimpleStoneWall
Declaration
public static readonly FurnitureType SimpleStoneWall
Field Value
SimpleToilet
Declaration
public static readonly FurnitureType SimpleToilet
Field Value
SimpleWallSink
Declaration
public static readonly FurnitureType SimpleWallSink
Field Value
SmallBarbecue
Declaration
public static readonly FurnitureType SmallBarbecue
Field Value
SmallBlinds
Declaration
public static readonly FurnitureType[] SmallBlinds
Field Value
SmallBush
Declaration
public static readonly FurnitureType SmallBush
Field Value
SmallCandlestick
Declaration
public static readonly FurnitureType SmallCandlestick
Field Value
SmallChimney
Declaration
public static readonly FurnitureType SmallChimney
Field Value
SmallMirror
Declaration
public static readonly FurnitureType SmallMirror
Field Value
SmallPicnicTable
Declaration
public static readonly FurnitureType SmallPicnicTable
Field Value
SmallPlant
Declaration
public static readonly FurnitureType SmallPlant
Field Value
SmallRocks
Declaration
public static readonly FurnitureType SmallRocks
Field Value
SmallShovel
Declaration
public static readonly FurnitureType SmallShovel
Field Value
SmallSimpleCurtain
Declaration
public static readonly FurnitureType SmallSimpleCurtain
Field Value
Spanner
Declaration
public static readonly FurnitureType Spanner
Field Value
Sponge
Declaration
public static readonly FurnitureType Sponge
Field Value
SquareDinnerTable
Declaration
public static readonly FurnitureType SquareDinnerTable
Field Value
SquarePlantPots
Declaration
public static readonly FurnitureType[] SquarePlantPots
Field Value
StandingCoatRack
Declaration
public static readonly FurnitureType StandingCoatRack
Field Value
StandingDesk
Declaration
public static readonly FurnitureType StandingDesk
Field Value
StorageBoxSeat
Declaration
public static readonly FurnitureType StorageBoxSeat
Field Value
StreetLamps
Declaration
public static readonly FurnitureType[] StreetLamps
Field Value
Succulents
Declaration
public static readonly FurnitureType[] Succulents
Field Value
SwirlWoodworkingLamp
Declaration
public static readonly FurnitureType SwirlWoodworkingLamp
Field Value
TallCountryFence
Declaration
public static readonly FurnitureType TallCountryFence
Field Value
Textures
The textures that this furniture type has.
Each texture is automatically loaded based on the registered MLEM.Data.DataTextureAtlas instances.
If a furniture type has multiple ColorMap entries (or multiple ColorSchemes), additional texture regions will automatically be created to the right of the original texture region.
Declaration
public readonly IDictionary<Direction2, TextureRegion[]> Textures
Field Value
Type |
Description |
System.Collections.Generic.IDictionary<MLEM.Misc.Direction2, MLEM.Textures.TextureRegion[]> |
|
TinyDinnerTable
Declaration
public static readonly FurnitureType TinyDinnerTable
Field Value
ToyCar
Declaration
public static readonly FurnitureType ToyCar
Field Value
TraditionalBar
Declaration
public static readonly FurnitureType TraditionalBar
Field Value
TraditionalBedsideLamp
Declaration
public static readonly FurnitureType TraditionalBedsideLamp
Field Value
TraditionalCounter
Declaration
public static readonly FurnitureType TraditionalCounter
Field Value
TraditionalFireplace
Declaration
public static readonly FurnitureType TraditionalFireplace
Field Value
Treadmill
Declaration
public static readonly FurnitureType Treadmill
Field Value
TreeStumps
Declaration
public static readonly FurnitureType[] TreeStumps
Field Value
Types
Declaration
public static readonly ReadOnlyDictionary<string, FurnitureType> Types
Field Value
Type |
Description |
System.Collections.ObjectModel.ReadOnlyDictionary<System.String, FurnitureType> |
|
UnfinishedWoodwork
Declaration
public static readonly FurnitureType UnfinishedWoodwork
Field Value
UnpreparedFood
Declaration
public static readonly FurnitureType UnpreparedFood
Field Value
Vases
Declaration
public static readonly FurnitureType[] Vases
Field Value
VerticalDumbbellRack
Declaration
public static readonly FurnitureType VerticalDumbbellRack
Field Value
WindowPlants
Declaration
public static readonly FurnitureType[] WindowPlants
Field Value
Wisteria
Declaration
public static readonly FurnitureType[] Wisteria
Field Value
WoodenPowerPole
Declaration
public static readonly FurnitureType WoodenPowerPole
Field Value
WoodenPowerPoleLine
Declaration
public static readonly FurnitureType WoodenPowerPoleLine
Field Value
Declaration
public static readonly FurnitureType WoodenStool
Field Value
WoodenToyBox
Declaration
public static readonly FurnitureType WoodenToyBox
Field Value
WoodworkingChair
Declaration
public static readonly FurnitureType WoodworkingChair
Field Value
WoodworkingChairArmrests
Declaration
public static readonly FurnitureType WoodworkingChairArmrests
Field Value
WoodworkingCloset
Declaration
public static readonly FurnitureType WoodworkingCloset
Field Value
WoodworkingTable
Declaration
public static readonly FurnitureType WoodworkingTable
Field Value
WorkoutPosters
Declaration
public static readonly FurnitureType[] WorkoutPosters
Field Value
Properties
Rotations
The valid rotations that this furniture has, which are based on the available Textures.
Declaration
public ICollection<Direction2> Rotations { get; }
Property Value
Type |
Description |
System.Collections.Generic.ICollection<MLEM.Misc.Direction2> |
|
SourceString
A (localized) string that is displayed when hovering over an EmotionModifier that has this source
Declaration
public string SourceString { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Construct(Int32[], Map, Vector2, Nullable<Guid>)
Constructs a new Furniture object from this furniture type
Declaration
public Furniture Construct(int[] colors, Map map, Vector2 pos, Guid? id = null)
Parameters
Type |
Name |
Description |
System.Int32[] |
colors |
The indices of the colors that the furniture should have
|
Map |
map |
The map that the furniture should be added to
|
Vector2 |
pos |
The position that the furniture should have
|
System.Nullable<System.Guid> |
id |
The id that the furniture should have, or a random one by defualt
|
Returns
Type |
Description |
Furniture |
A new furniture instance of this type
|
DrawColumns(Map, Vector2, SpriteBatch, Vector2, Direction2, TextureRegion, Color, Single, Boolean, ParentInfo, Single, Boolean, SpriteEffects)
This method is a semi-overload of DrawColumns(Map, Vector2, SpriteBatch, Vector2, TextureRegion, Color, Single, Point, Boolean, ParentInfo, Single, SpriteEffects, Boolean, Boolean, Boolean) that additionally calculates some values required for rendering furniture with certain ObjectCategory values correctly
Declaration
public void DrawColumns(Map map, Vector2 position, SpriteBatch batch, Vector2 drawPos, Direction2 rotation, TextureRegion texture, Color color, float scale, bool pivot = true, ParentInfo parent = default(ParentInfo), float depthOffset = 0F, bool held = false, SpriteEffects effects = null)
Parameters
Type |
Name |
Description |
Map |
map |
The map that the object is on
|
Vector2 |
position |
The position that the object is on, in world space
|
SpriteBatch |
batch |
The sprite batch to draw with
|
Vector2 |
drawPos |
The position to draw at, in draw space
|
MLEM.Misc.Direction2 |
rotation |
The rotation that this object has, used for some calculations
|
MLEM.Textures.TextureRegion |
texture |
The texture region to draw
|
Color |
color |
The color to draw with
|
System.Single |
scale |
The scale to draw at
|
System.Boolean |
pivot |
The texture's pivot point, in texture-space pixels
|
ParentInfo |
parent |
The object's parent object
|
System.Single |
depthOffset |
A value that is added to the calculated object's depth
|
System.Boolean |
held |
Whether this object is currently being held by a Person
|
SpriteEffects |
effects |
The sprite effects to use when rendering
|
DrawDirtyOverlay(Map, Vector2, SpriteBatch, Vector2, Direction2, Single, Nullable<Color>, Boolean, ParentInfo, Single, Boolean)
Draws the DirtyTextures of this object into the world.
Note that, if this object cannot get dirty, this method will throw a System.NullReferenceException.
By default, the dirty overlay is automatically drawn in .
Declaration
public void DrawDirtyOverlay(Map map, Vector2 position, SpriteBatch batch, Vector2 drawPos, Direction2 rotation, float scale, Color? overrideColor = null, bool pivot = true, ParentInfo parent = default(ParentInfo), float depthOffset = 0F, bool held = false)
Parameters
Type |
Name |
Description |
Map |
map |
The map that the object is on
|
Vector2 |
position |
The position that the object is on, in world space
|
SpriteBatch |
batch |
The sprite batch to draw with
|
Vector2 |
drawPos |
The position to draw at, in draw space
|
MLEM.Misc.Direction2 |
rotation |
The rotation that this object has, used for some calculations
|
System.Single |
scale |
The scale to draw at
|
System.Nullable<Color> |
overrideColor |
An optional color to override the default colors of the furniture
|
System.Boolean |
pivot |
The texture's pivot point, in texture-space pixels
|
ParentInfo |
parent |
The object's parent object
|
System.Single |
depthOffset |
A value that is added to the calculated object's depth
|
System.Boolean |
held |
Whether this object is currently being held by a Person
|
DrawLayers(Map, Vector2, SpriteBatch, Vector2, Direction2, TextureRegion[], Int32[], Single, Boolean, ParentInfo, Nullable<Color>, Single, Boolean)
Draws the furniture type with the given data.
Internally, this uses DrawColumns(Map, Vector2, SpriteBatch, Vector2, Direction2, TextureRegion, Color, Single, Boolean, ParentInfo, Single, Boolean, SpriteEffects) to draw each layer with a slight depth offset.
Declaration
public void DrawLayers(Map map, Vector2 position, SpriteBatch batch, Vector2 drawPos, Direction2 rotation, TextureRegion[] layers, int[] colors, float scale, bool pivot = true, ParentInfo parent = default(ParentInfo), Color? overrideColor = null, float depthOffset = 0F, bool held = false)
Parameters
Type |
Name |
Description |
Map |
map |
The map to draw the furniture type on
|
Vector2 |
position |
The position on the map that the furniture is at
|
SpriteBatch |
batch |
The sprite batch used for drawing
|
Vector2 |
drawPos |
The position that this furniture should be drawn at on the screen
|
MLEM.Misc.Direction2 |
rotation |
The rotation of the furniture
|
MLEM.Textures.TextureRegion[] |
layers |
The textures to draw this furniture with
|
System.Int32[] |
colors |
The indices in the ColorSchemes that the furniture should be drawn with
|
System.Single |
scale |
The scale that the furniture should be drawn with
|
System.Boolean |
pivot |
Whether or not the furniture should be shifted by its pivot point
|
ParentInfo |
parent |
The parent that the furniture is attached to. Can be null.
|
System.Nullable<Color> |
overrideColor |
The color that should be used to draw this furniture instead of colors
|
System.Single |
depthOffset |
A value that is added to the depth calculation for drawing this furniture type
|
System.Boolean |
held |
Whether or not this item is currently being held by a Person
|
GetBestRotation(Direction2)
Returns a MLEM.Misc.Direction2 that is closest to goal
, but that this object is allowed to have.
The return value is guaranteed to be contained in Rotations and have the same verticality as goal
, or be the same value.
Declaration
public Direction2 GetBestRotation(Direction2 goal)
Parameters
Type |
Name |
Description |
MLEM.Misc.Direction2 |
goal |
The goal rotation
|
Returns
Type |
Description |
MLEM.Misc.Direction2 |
The closest possible rotation to the goal rotation
|
GetConstructedType()
Declaration
public Type GetConstructedType()
Returns
Type |
Description |
System.Type |
The type to construct for this furniture type's instance.
|
GetCoveredTiles(Vector2, Point)
Returns a rectangle that contains all of the tiles which intersect with the furniture when placed at the given position, with the given size.
Declaration
public static Rectangle GetCoveredTiles(Vector2 pos, Point size)
Parameters
Type |
Name |
Description |
Vector2 |
pos |
The position to place the furniture at
|
Point |
size |
The size of the furniture
|
Returns
Type |
Description |
Rectangle |
A rectangle with all of the tiles that are covered
|
GetDisplayName(Furniture)
Returns this furniture item's display name, optionally based on the given Furniture instance
.
Declaration
public string GetDisplayName(Furniture instance)
Parameters
Type |
Name |
Description |
Furniture |
instance |
The furniture instance to get the name for, or null to get the default name.
|
Returns
Type |
Description |
System.String |
This furniture item's display name.
|
GetPrice()
Returns the price that this object can be bought or sold for.
Note that, like in the case of the Painting, the returned price isn't necessarily the full price that the object can be sold for. Instead, the price returned here should be the price that this object has when bought or sold from the FurnitureTool or similar.
Declaration
Returns
Type |
Description |
System.Single |
The object's price
|
GetReferenceTexture(Nullable<Direction2>)
Returns the reference texture of this furniture type for the given rotation.
The reference texture is the first layer of the texture for the given rotation.
Declaration
public TextureRegion GetReferenceTexture(Direction2? rotation = null)
Parameters
Type |
Name |
Description |
System.Nullable<MLEM.Misc.Direction2> |
rotation |
The rotation to get the reference texture for. Defaults to DefaultRotation.
|
Returns
Type |
Description |
MLEM.Textures.TextureRegion |
The reference texture for the given rotation
|
GetRoofingInTheWay(Map, Vector2, Direction2, ICollection<Roof>)
Returns a set of roofing that would be in the way if this furniture type was placed at the given position with the given rotation.
Note that, if this furniture type does not have the ObstructedByRoofs category, no roofs will be returned.
Declaration
public IEnumerable<Roof> GetRoofingInTheWay(Map map, Vector2 pos, Direction2 rotation, ICollection<Roof> possibleAdditionalRoofs = null)
Parameters
Type |
Name |
Description |
Map |
map |
The map to place the furniture on
|
Vector2 |
pos |
The position that the furniture should be placed at
|
MLEM.Misc.Direction2 |
rotation |
The rotation that the furniture should have
|
System.Collections.Generic.ICollection<Roof> |
possibleAdditionalRoofs |
A set of roofs that have not been placed yet, but might also be in the way.
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Roof> |
A set of roofing that would be in the way
|
GetRotatedOffset(Vector2, Direction2, Direction2)
Returns the rotated offset of the given position, based on this furniture type's Size.
This method is used to offset the position of furniture objects based on their (visual) rotation.
Declaration
public Vector2 GetRotatedOffset(Vector2 offset, Direction2 objectRotation, Direction2 rotation)
Parameters
Type |
Name |
Description |
Vector2 |
offset |
The offset position to rotate
|
MLEM.Misc.Direction2 |
objectRotation |
The original rotation of the object
|
MLEM.Misc.Direction2 |
rotation |
The rotation to rotate by
|
Returns
Type |
Description |
Vector2 |
The rotated offset of the offset
|
GetSize(Direction2)
Returns the Size of this furniture type, modified based on the given rotation.
Declaration
public Point GetSize(Direction2 rotation)
Parameters
Type |
Name |
Description |
MLEM.Misc.Direction2 |
rotation |
The rotation to return the size for
|
Returns
Type |
Description |
Point |
The modified size
|
GetTexture(String, Boolean)
Declaration
public static TextureRegion GetTexture(string name, bool throwIfNotFound = true)
Parameters
Type |
Name |
Description |
System.String |
name |
The name of the texture to get
|
System.Boolean |
throwIfNotFound |
Whether an exception should be thrown if the texture is not found
|
Returns
Type |
Description |
MLEM.Textures.TextureRegion |
A texture region with the given name, or null if there is none
|
GetTextures(String, Int32, Func<Direction2, Boolean>)
Create a dictionary of textures for all MLEM.Misc.Direction2Helper.Adjacent directions that have a texture registered for them.
Textures are gathered using GetCustomFurnitureTextures(ModInfo), and textures need to be suffixed with the direction's string to be recognized.
This method is used for furniture of all kinds.
Declaration
public static Dictionary<Direction2, TextureRegion[]> GetTextures(string name, int amount = 1, Func<Direction2, bool> shouldThrow = null)
Parameters
Type |
Name |
Description |
System.String |
name |
The name of the texture to load
|
System.Int32 |
amount |
The amount of layers the texture has
|
System.Func<MLEM.Misc.Direction2, System.Boolean> |
shouldThrow |
Whether an exception should be thrown if the texture is not found
|
Returns
Type |
Description |
System.Collections.Generic.Dictionary<MLEM.Misc.Direction2, MLEM.Textures.TextureRegion[]> |
A dictionary of directions to texture layers
|
GetWallsInTheWay(Map, Vector2, Direction2, ICollection<Wall>)
Returns a set of walls that would be in the way if this furniture type was placed at the given position with the given rotation
Declaration
public IEnumerable<Wall> GetWallsInTheWay(Map map, Vector2 pos, Direction2 rotation, ICollection<Wall> possibleAdditionalWalls = null)
Parameters
Type |
Name |
Description |
Map |
map |
The map to place the furniture on
|
Vector2 |
pos |
The position that the furniture should be placed at
|
MLEM.Misc.Direction2 |
rotation |
The rotation that the furniture should have
|
System.Collections.Generic.ICollection<Wall> |
possibleAdditionalWalls |
A set of walls that have not been placed yet, but might also be in the way.
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Wall> |
A set of walls that would be in the way
|
HasCategory(ObjectCategory)
Declaration
public bool HasCategory(ObjectCategory category)
Parameters
Returns
Type |
Description |
System.Boolean |
Whether any of the passed categories are present
|
Register(FurnitureType.TypeSettings)
Registers a custom furniture type
Declaration
public static FurnitureType Register(FurnitureType.TypeSettings settings)
Parameters
Returns
RegisterAll(IEnumerable<FurnitureType.TypeSettings>)
Registers a set of custom furniture type and returns them
Declaration
public static FurnitureType[] RegisterAll(IEnumerable<FurnitureType.TypeSettings> settings)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<FurnitureType.TypeSettings> |
settings |
The settings to apply to the custom furniture type
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
Implements
MLEM.Misc.IGenericDataHolder
Extension Methods