TinyLife_Objects - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life

TinyLife.Objects Namespace

Classes
AbstractSpot An AbstractSpot is a base class for ObjectSpot and ActionSpot.
ActionSpot An action spot is a AbstractSpot extension that is used by Furniture to declare a location that a Person can interact with the furniture at
BreakableFurniture Breakable furniture is Furniture that can be Broken and then repaired.An object of this class is automatically returned in Construct(int[], Map, Vector2, Nullable<Guid>) if no ConstructedType is set.
Car An instance of this class represents an object that can be, or is, part of a Map.If this object's Position is set to -1, -1, that is usually an indicator that the object is currently not in the world.
Clothes A set of information and a registry for clothing items (and hair) that a Person can wear.Custom clothes can be registered using Register(Clothes).
CornerFurniture 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 Counter can be used.For objects with custom connection logic, you can override ShouldConnectTo(Furniture) and GetCornerStatus(Dictionary<Direction2,Direction2>).
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.
Fence A fence is a furniture used by things like TinyLife.Objects.FurnitureType.CountryFence that auto-connects similarly to CornerFurniture, but by actually adding additional connection textures onto the regular object textures
Food A furniture is an instance of a FurnitureType which is placed in the world, or in a Person's hand.To register a custom furniture, use Register(TypeSettings).
FoodTypedItem A furniture is an instance of a FurnitureType which is placed in the world, or in a Person's hand.To register a custom furniture, use Register(TypeSettings).
Furniture A furniture is an instance of a FurnitureType which is placed in the world, or in a Person's hand.To register a custom furniture, use Register(TypeSettings).
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(TypeSettings).
Gravestone A furniture is an instance of a FurnitureType which is placed in the world, or in a Person's hand.To register a custom furniture, use Register(TypeSettings).
Light A light is a semi-object that can be added to a Map using AddLight(Light).A light draws a light texture onto a lightmap and, as such, adds lighting to the rendered world.
LightFurniture Light furniture is a furniture that additionally spawns and handles a set of Light instances.To use this class effectively, set CreateLights to determine the lights that should be spawned from the furniture.
MapObject An instance of this class represents an object that can be, or is, part of a Map.If this object's Position is set to -1, -1, that is usually an indicator that the object is currently not in the world.
ObjectCategory An object category is a way to tell the Action and AbstractSpot system what type an object is.An object can have any number of categories attached to it, since MLEM.Data.DynamicEnum provides System.FlagsAttribute-like behavior.Custom modded categories can be added and retrieved using GetModCategory(string).
ObjectSpot An object spot is a AbstractSpot extension that is used by Furniture to declare a location that another Furniture object can be slotted into.This behavior is used for things like plates on counters, flower pots on bedside tables etc.
OverlayWallHanging A class for a wall-hung object like TinyLife.Objects.FurnitureType.LgbtFlags and TinyLife.Objects.FurnitureType.WorkoutPosters.Objects that use this class have a default "border" texture that requires all rotations to be present as usual, and an overlay texture that automatically gets rotated and mirrored.To set a default border texture that is different from the overlay, TextureName should be set explicitly.
Painting A furniture is an instance of a FurnitureType which is placed in the world, or in a Person's hand.To register a custom furniture, use Register(TypeSettings).
Particle A particle is a MLEM.Animations.SpriteAnimation that can be moved and displayed in world space.A particle is simply a MapObject that does not collide or interact directly with the world, but has all of the same properties.A new particle can be added for display using Spawn(Particle).
Person A person is a MapObject placed on a Map that represents a person.It stores its actions, clothes, data and movement.
PersonAi This class holds the artificial intelligence implementation for a Person.The AI automatically selects actions based on their AiSettings.
Puddle
ScreenObject A furniture is an instance of a FurnitureType which is placed in the world, or in a Person's hand.To register a custom furniture, use Register(TypeSettings).
WornClothes WornClothes is a wrapper around Clothes that additionally stores the colors and whether or not the clothes are from the ClothesStorage or not
Structs
FurnitureType.TypeSettings A set of settings that define the properties of a FurnitureType
Interfaces
IUpdatingObject This is an interface that can be added to MapObject classes to make them automatically update each update frame.This is used by things like Person, which needs to update for movement etc.
Enums
BreakableFurniture.BrokenBehavior A set of enumeration flags that can be used to determine the behavior that a BreakableFurniture has when it is broken
ClothesIntention A clothes intention is a way that a clothing item can be used.Since this enumeration uses the System.FlagsAttribute, a clothing item can have multiple intentions.
ClothesLayer A flag enumeration that defines a set of layers that a Person's Clothes are rendered with.The ordering is based on the order that these should be drawn in.
Person.DeathReason An enum that represents a set of possible reasons for a Person's death
Person.Pose An enumeration that represents a set of poses that a Person can display
SpeakStyle A speak style is a category that speaking sounds can apply to.Each speak style contains a variety of sound effects that can be received using GetRandomSpeakSound(SpeakStyle, List<SoundEffect>, Nullable<TimeSpan>) or played for a person using Speak(SpeakStyle, float, float).Note that these categories are rather vague, and that speech, in general, is not supposed to be immediately decypherable based on the speaking style used. As such, speak styles are just a very rough guidance for the sounds played.
Visibility An enumeration that represents visibility settings for MapObject objects
Delegates
Person.ActionUpdateDelegate(Action, GameTime, TimeSpan, GameSpeed, EventPhase) A delegate used for OnActionUpdated
Person.EfficiencyModifierDelegate(SkillType, float, float) A delegate used for OnGetEfficiencyModifier
Person.PassiveActionPriorityDelegate(ActionType, float) A delegate used for OnGetPassiveActionPriority
Person.WalkSpeedDelegate(float) A delegate used for OnGetWalkSpeed