TinyLifeExampleMod/ApiDocumentation.md
2021-02-02 09:16:46 +01:00

688 KiB

Tiny Life

Contents

AbstractSpot type

Namespace

TinyLife.Objects

Summary

An AbstractSpot is a base class for ObjectSpot and ActionSpot.

#ctor(offset,visualOffset,yOffset,validDirections) constructor

Summary

Creates a new spot with the given data. This is called by ObjectSpot and ActionSpot.

Parameters
Name Type Description
offset Microsoft.Xna.Framework.Vector2 The offset on both the x and y axis that this spot has
visualOffset Microsoft.Xna.Framework.Vector2 The visual offset on both the x and y axis that this spot has
yOffset System.Single The offset on the visual y axis
validDirections MLEM.Misc.Direction2[] The directions that this spot can be accessed from

Offset constants

Summary

The offset on both the x and y axis that this spot has from the position of the Furniture it belongs to

ValidDirections constants

Summary

The Direction2 values that this spot can be accessed from. These directions are relative to the owning Furniture's Up direction.

VisualOffset constants

Summary

The visual offset on both the x and y axis that this spot has from the position of the Furniture it belongs to. By default, this gets set to the same value as Offset.

YOffset constants

Summary

The offset on the visual y axis that the Furniture or Person slotted into this spot should render with

GetLocation(furniture,visual) method

Summary

Returns the location that this spot has in world space, based on the given Furniture and its position and rotation.

Returns

This spot's location in world space

Parameters
Name Type Description
furniture TinyLife.Objects.Furniture The furniture that this spot belongs to
visual System.Boolean Whetehr the VisualOffset should be used instead of the Offset

GetValidDirections(rotation) method

Summary

Returns the ValidDirections of this spot, but rotated by the given Direction2.

Returns

The rotations that are valid for this spot

Parameters
Name Type Description
rotation MLEM.Misc.Direction2 The rotation

Action type

Namespace

TinyLife.Actions

Summary

An action is something that a Person does. An action is always derived from an underlying ActionType that contains various action settings. Actions can be queued up for a person (ActionQueue) or currently active (CurrentActions). To create a more complex action, it is best to extend MultiAction.

#ctor(type,info) constructor

Summary

Creates a new action from the given ActionType

Parameters
Name Type Description
type TinyLife.Actions.ActionType The type to create this action from
info TinyLife.Actions.ActionInfo The information for this action

ForceFail constants

Summary

This value can be set to true to force IsCompleted to return Failed. This is useful if there is an erroring calculation in your Update code etc.

Info constants

Summary

The ActionInfo for this action that contains the clicked (or otherwise targeted) objects and more

Random constants

Summary

A Random instance that can be used by actions. This value has the default seed.

Type constants

Summary

The ActionType that this action instance derives from

ElapsedTime property

Summary

The amount of in-game time that has elapsed since this action has started

IsCurrent property

Summary

Returns true if this action instance is currently active. This is a shorthand for a CurrentActions containment check.

Map property

Summary

The Map that this action occurs on

Person property

Summary

The Person that this action is being executed by

StartedAutomatically property

Summary

If this value is true, this action was started using PersonAi rather than by the player

Variety property

Summary

The ActionVariety that this action was initialized with. If this is null, then the underlying ActionType has no varieties.

CanCancel(cancelSource) method

Summary

Returns whether or not this action can be canceled by the given outside source. Note that the outside source can be null, and if it is, it means that the player canceled the action manually. By default, actions can only be canceled if the cancelSource is null.

Returns

true if the action can be canceled

Parameters
Name Type Description
cancelSource TinyLife.Actions.Action The source of the cancelation, or null if the player canceled it

CanEnqueueConversation(person,type) method

Summary

Returns true if the given person can (automatically) enqueue a social action with the Person that is executing this action. Note that enqueueing a social action manually is still possible even if this method returns false. By default, only SleepAction returns false on this method.

Returns

Whether or not enqueueing a social action is possible

Parameters
Name Type Description
person TinyLife.Objects.Person The person that wants to converse with us
type TinyLife.Actions.ActionType The type of action that should be enqueued

CanMultitask(other) method

Summary

Return true on this method if this action can be multi-tasked along with the passed Action. A multi-tasking is an action that IsCurrent along with another action. By default, multi-tasking is disallowed for any action.

Returns

Whether this action can be multi-tasked

Parameters
Name Type Description
other TinyLife.Actions.Action The action to multi-task with

CausesExtremelyFastSpeed() method

Summary

Returns true if this action, while it IsCurrent, should cause the ExtremelyFast speed to be available. By default, this method returns false.

Returns

Whether the extremely fast speed should be available

Parameters

This method has no parameters.

CompleteIfNeedFull(type,els) method

Summary

A helper method that returns Completed if the given Need's value is at Max.

Returns

The appropriate completion type

Parameters
Name Type Description
type TinyLife.NeedType The need that should be completed
els TinyLife.Actions.Action.CompletionType The action type that is returned if the need is not completed. Active by default.

FindAllFreeFurniture(person,categories,objectSpotType,needsFreeActionSpot,position,radius) method

Summary

A helper method to find a set of all Furniture instances that are currently valid for interaction with the passed Person

Returns

A set of valid furniture

Parameters
Name Type Description
person TinyLife.Objects.Person The person that wants to start the aciton
categories TinyLife.Objects.ObjectCategory The categories that the furniture should have
objectSpotType TinyLife.Objects.FurnitureType The type of item that an object spot should be available for, or null if this is not required
needsFreeActionSpot System.Boolean Whether or not the furniture returned needs a non-occupied ActionSpot
position System.Nullable{Microsoft.Xna.Framework.Vector2} The position that we should find people around, or null to use the passed person's position
radius System.Int32 The radius that should be searched for people in, or 32 by default

FindAllFreePeople(type,person,position,radius) method

Summary

A helper method to find a set of all Person instances that are currently valid for interaction with the passed Person

Returns

A set of valid interaction partners

Parameters
Name Type Description
type TinyLife.Actions.ActionType The type of action we want to start
person TinyLife.Objects.Person The person that wants to start the aciton
position System.Nullable{Microsoft.Xna.Framework.Vector2} The position that we should find people around, or null to use the passed person's position
radius System.Int32 The radius that should be searched for people in, or 32 by default

FindFreeFurniture(person,categories,objectSpotType,position) method

Summary

A helper method to find the best Furniture instance to interact with based on the given data. Note that this method always returns a ActionInfo related to the first result from FindAllFreeFurniture.

Returns

An action info for the best furniture, or null if there is none

Parameters
Name Type Description
person TinyLife.Objects.Person The person that wants to start the aciton
categories TinyLife.Objects.ObjectCategory The categories that the furniture should have
objectSpotType TinyLife.Objects.FurnitureType The type of item that an object spot should be available for, or null if this is not required
position System.Nullable{Microsoft.Xna.Framework.Vector2} The position that we should find people around, or null to use the passed person's position

GetChair(deskObject) method

Summary

A helper method that returns a Furniture with the Chair category that is closest to the given object which is on a desk or table. The furniture returned is the one that the person should Sit on when interacting with the passed deskObject.

Returns

The corresponding chair, or null if there is none

Parameters
Name Type Description
deskObject TinyLife.Objects.Furniture The object that is sat on a desk

GetDisplayName() method

Summary

Returns a localized string that explains this action in short. By default, this method returns GetDisplayName.

Returns

This action's display name

Parameters

This method has no parameters.

GetIconObject() method

Summary

Returns the map object that is displayed in the action queue in the top left of the screen. Note that this value is ignored if this action's type has a Texture. By default, the GetActionObject``1 is returned.

Returns

The icon object

Parameters

This method has no parameters.

GetNextAction(completion) method

Summary

Returns an action that should be queued up immediately after this action completes. The queued up action is immediately started in the slot that this action occupied. Can be null, and is null by default.

Returns

The follow-up action

Parameters
Name Type Description
completion TinyLife.Actions.Action.CompletionType The type that this action completed with

GetPlaceDirection(item) method

Summary

Returns a Direction2 that represents the facing that the given FurnitureType should be placed with. The direction is determined by the Person's current rotation.

Returns

The facing the item should be placed with

Parameters
Name Type Description
item TinyLife.Objects.FurnitureType The item to place

GetTableSpot(chair) method

Summary

A helper method that returns the ObjectSpot on the table or desk that the given chair is connected to. This is the object spot that should be used for interaction if a person sits on the given chair.

Returns

The table spot, or null if there is none

Parameters
Name Type Description
chair TinyLife.Objects.Furniture The chair to get the table spot for

Initialize() method

Summary

This method is called when the action is first started by a Person. Note that it is not called when the action gets added to the ActionQueue, but when it is moved to CurrentActions.

Parameters

This method has no parameters.

IsCompleted() method

Summary

This method is called every update frame by a Person if this action IsCurrent to check if it should be stopped. If this returns a result other than Completed, OnCompleted will be called and the action is stopped. By default, only ForceFail modifies the completion type, otherwise Active is returned.

Returns

The current completion type of this action

Parameters

This method has no parameters.

OnCompleted(type) method

Summary

This method is called when this action IsCompleted, or if it is canceled from an outside source. Note that, if this method is called as a result of IsCompleted, the CompletionType passed will be the same.

Parameters
Name Type Description
type TinyLife.Actions.Action.CompletionType The type that this action completed with

PutDownOrGoTo(parentToPutOn,items) method

Summary

A helper method used by PrepareFoodAction and CookFoodAction that causes the Person to walk to a valid surface with the action item on it, plcae the action item down on a valid surface or move the action object from its current location to a valid surface. The validity of the surface is determined by parentToPutOn, and the item to find is any of items.

Returns

A set of actions that cause the person to set the action object up correctly

Parameters
Name Type Description
parentToPutOn TinyLife.Objects.ObjectCategory An object category that the object's surface should have
items TinyLife.Objects.FurnitureType[] The items that should be found on the surface

Sit(chair,speed) method

Summary

A helper method that causes the Person to sit on the given object. This method causes the action spot to be occupied and the person's CurrentPose to be changed to Sitting. Additionally, the Energy need is restored a little bit. Note that this method has to be called every Update frame for the person to stay sat down.

Returns

Whether or not the chair can be sat on

Parameters
Name Type Description
chair TinyLife.Objects.Furniture The chair to sit on
speed TinyLife.GameSpeed The current game speed

Update(time,passedInGame,speed) method

Summary

This method is called every update frame if this action IsCurrent. By default, only the ElapsedTime is modified in this method.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current game time
passedInGame System.TimeSpan The amount of time that has passed, in game time
speed TinyLife.GameSpeed The game's current speed setting

Validate(person) method

Summary

Validates this action's data. This is called when a map is loaded from disk. When returning false on this method, the action is removed from the Person.

Returns

Whether or not the action is still valid (or if it has invalid data)

Parameters
Name Type Description
person TinyLife.Objects.Person The person that this action belongs to

ActionInfo type

Namespace

TinyLife.Actions

Summary

An action info is a set of information that is required to execute an action

ActionLocation constants

Summary

The location that this action should be executed in. Note that this is mostly only relevant if there is no ActionObject.

ActionObject constants

Summary

The Guid of the object that this action is related to. Can be Empty, which indicates that there is no action object. To retrieve the actual object, use GetActionObject``1.

ActionSpot property

Summary

The ActionSpot that this action is related to. Can be null, even if the ActionObject exists.

Map property

Summary

The Map that the action is executed on

Person property

Summary

The Person that is currently executing the action

FromLocation(person,location) method

Summary

Returns a new ActionInfo based on the given location (and no objects)

Returns

A new action info with the given data

Parameters
Name Type Description
person TinyLife.Objects.Person The person that this action info should be related to
location Microsoft.Xna.Framework.Vector2 The location that this action info should have

FromObjectGeneric(person,obj) method

Summary

Returns a new ActionInfo basd on the given object, but no object spot

Returns

A new action info with the given data

Parameters
Name Type Description
person TinyLife.Objects.Person The person that this action info should be related to
obj TinyLife.Objects.MapObject The object that this action info should have

GetActionObject``1() method

Summary

Returns the object that this action is related to, or null if there is none or the object isn't of the given type.

Returns

The action object, or null if there is none or the type does not match

Parameters

This method has no parameters.

Generic Types
Name Description
T The type that the action object is expected to be of

GetObjectOrChild``1(category) method

Summary

Returns the action object (GetActionObject``1) or the action object's child if the action object does not have the required category.

Returns

The action object, its child, or null if neither match

Parameters
Name Type Description
category TinyLife.Objects.ObjectCategory The category that the action object (or its child) should have
Generic Types
Name Description
T The type that we expect the object (or its child) to be

GetObjectOrParent``1(category) method

Summary

Returns the action object (GetActionObject``1) or the action object's parent if the action object does not have the required category.

Returns

The action object, its parent, or null if neither match

Parameters
Name Type Description
category TinyLife.Objects.ObjectCategory The category that the action object (or its parent) should have
Generic Types
Name Description
T The type that we expect the object (or its parent) to be

OccupyFreeActionSpot(context,enter,rotation) method

Summary

This is a shorthand method for GetFreeActionSpot and OccupyActionSpot. Note that this method needs to be called every update frame for the person to keep occupying the action spot.

Returns

Whether or not we were able to occupy a free action spot

Parameters
Name Type Description
context TinyLife.Objects.ObjectCategory The category that the action spot should have
enter System.Boolean Whether or not the action spot should be entered
rotation System.Nullable{MLEM.Misc.Direction2} The rotation that the person should have, or the action spot's rotation by default

ToFreeActionSpot(context) method

Summary

This is a shorthand method for GetFreeActionSpotInfo that is applied to our action object (GetActionObject``1).

Returns

The corresponding action info, or null if there is none

Parameters
Name Type Description
context TinyLife.Objects.ObjectCategory The category that the action spot should have

Validate(person) method

Summary

Validates this action info. This method should only be called when this action info is read from disk.

Parameters
Name Type Description
person TinyLife.Objects.Person The person that this action info belongs to

ActionSpot type

Namespace

TinyLife.Objects

Summary

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

#ctor(offset,validDirections) constructor

Summary

Creates a new action spot with the given settings

Parameters
Name Type Description
offset Microsoft.Xna.Framework.Vector2 The offset on both the x and y axis that this spot has
validDirections MLEM.Misc.Direction2[] The directions that this spot can be accessed from

#ctor(offset,yOffset,validDirections) constructor

Summary

Creates a new action spot with the given settings

Parameters
Name Type Description
offset Microsoft.Xna.Framework.Vector2 The offset on both the x and y axis that this spot has
yOffset System.Single The offset on the visual y axis
validDirections MLEM.Misc.Direction2[] The directions that this spot can be accessed from

#ctor(offset,visualOffset,yOffset,validDirections) constructor

Summary

Creates a new action spot with the given settings

Parameters
Name Type Description
offset Microsoft.Xna.Framework.Vector2 The offset on both the x and y axis that this spot has
visualOffset Microsoft.Xna.Framework.Vector2 The visual offset on both the x and y axis that this spot has
yOffset System.Single The offset on the visual y axis
validDirections MLEM.Misc.Direction2[] The directions that this spot can be accessed from

CategoryRestriction constants

Summary

The categories that this ActionSpot is restricted to. This is used by things like ModernBed to declare separate spots for sitting on and sleeping on. By default, this is set to null.

DrawLayer constants

Summary

The layer that a person slotted into this action spot using OccupyActionSpot is drawn on. By default, this is set to 0, meaning it will be drawn on top of the first layer of this furniture.

Group constants

Summary

The group that this spot has. Two action spots with the same group cannot both be occupied by two different people. This is used by things lke ModernBed to stop people from sitting on a side there someone is already sleeping. By default, this is set to null.

GetFreeDirections(furniture,person) method

Summary

Returns a set of Direction2 values that this spot can be accessed from. Valid directions will have an empty space that a Person can stand in, but not necessarily walk to. The returned value is used by GetFreeActionSpots and GetFreeActionSpotInfo to find a location adjacent to this action spot that a Person can walk to.

Returns

A set of directions that are considered free, or an empty set if there are none

Parameters
Name Type Description
furniture TinyLife.Objects.Furniture The furnituret that this action spot belongs to
person TinyLife.Objects.Person The person trying to use this action spot

GetOccupants(furniture,includeGroup) method

Summary

Returns a set of the Person instances that are currently occupying this action spot. Note that an action spot is also marked as occupied if the person is currently on their way to it.

Returns

A set of people interacting with this action spot

Parameters
Name Type Description
furniture TinyLife.Objects.Furniture The furnituret that this action spot belongs to
includeGroup System.Boolean Whether to include other action spots that have the same Group

ActionType type

Namespace

TinyLife.Actions

Summary

Action types are blueprints for Action instances which can be registered using Register. An action type contains information about its action and can create an instance using Construct.

Types constants

Summary

A list of all available action types. To register your own action types, use the Register method.

Settings property

Summary

The TypeSettings for this action type, which actually contain this type's properties.

CanPlaceHeldItem(info,automatic) method

Summary

A helper method intended to be used with CanExecuteDelegate that determines whether or not the item that is currently held by the given person can be placed in an object spot on the given object.

Returns

Valid if the object has a free object spot, otherwise Hidden

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
automatic System.Boolean Whether or not this action is started automatically. This property is unused, but present for ease of use with CanExecute

Construct(info,variety) method

Summary

Creates a new Action instance of this ActionType.

Returns

A new action instance with the given information

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The info that this action should be constructed with
variety System.Nullable{TinyLife.Actions.ActionVariety} The variety, or null if this action has no varieties

GetDisplayName() method

Summary

Returns a localized string that explains this action type in short. Note that, for instantiated actions, GetDisplayName should be used.

Returns

This action type's display name

Parameters

This method has no parameters.

GetMatchingActions(contextFlags) method

Summary

Returns a set of actions that match any the given ObjectCategory flag values. No check occurs that determines whether or not the action is valid in any given circumstance, other than the category.

Returns

A set of action types that match the given flag

Parameters
Name Type Description
contextFlags TinyLife.Objects.ObjectCategory The categories that should be checked, can be a combined flag

HasChair(info,automatic) method

Summary

A helper method intended to be used with CanExecuteDelegate that determines if the given object is sat on a table or desk that has a chair.

Returns

Valid if there is a chair, NoChair if there is no valid chair

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
automatic System.Boolean Whether or not this action is started automatically. This property is unused, but present for ease of use with CanExecute

IsComfortable(info,automatic) method

Summary

A helper method intended to be used with CanExecuteDelegate that determines if the person is comfortable enough to execute an action. A comfortable person is one that doesn't have the Uncomfortable or Sad emotions.

Returns

Valid if the person is comfortable, TooUncomfortable otherwise

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
automatic System.Boolean Whether this action is automatic (unused)

IsDislikedOrMean(info,automatic) method

Summary

A helper method intended to be used with CanExecuteDelegate that determines if the action is executed manually, the given ActionInfo's person has the Mean personality type, or if the interaction partner has the Disliked relationship type (or lower).

Returns

Valid if any of the conditions are met, otherwise Hidden

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
automatic System.Boolean Whether this action is automatic

IsEmptyHanded(info,automatic) method

Summary

A helper method intended to be used with CanExecuteDelegate that determines if the person is not holding an item.

Returns

Valid if the person's hands are empty, HoldingItem otherwise

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
automatic System.Boolean Whether this action is automatic (unused)

IsHoldingOrPlaceableOn(info,goalParent,isAllowed) method

Summary

A helper method to check whether or not the person in the given ActionInfo is an item that matches the predicate (isAllowed) and the GetActionObject``1 is of the required type (goalParent) or if the action object itself matches the predicate. For example, PrepareFood uses this method for its CanExecute check:

CanExecute = (i, a) => IsHoldingOrPlaceableOn(i, ObjectCategory.Counter, t => t == FurnitureType.UnpreparedFood)
Returns

A result that represents the validity of the action

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
goalParent TinyLife.Objects.ObjectCategory The object that the required item should be a child of
isAllowed System.Predicate{TinyLife.Objects.FurnitureType} A predicate that checks if the given item is the one searched for

IsNotEmbarrassed(info,automatic) method

Summary

A helper method intended to be used with CanExecuteDelegate that determines if the person is Embarrassed or not

Returns

Valid if the person is not embarrassed, TooEmbarrassed otherwise

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
automatic System.Boolean Whether this action is automatic (unused)

IsReadyForRomance(info,automatic) method

Summary

A helper method intended to be used with CanExecuteDelegate that determines if the Person and their interaction partner are Unrelated and whether the action is executed manually or their RomanceLevel is higher than 0. This method should be used for SocialAction actions that are romantic in nature.

Returns

Valid if any of the conditions are met, otherwise Hidden

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
automatic System.Boolean Whether this action is automatic

Register(settings) method

Summary

Registers a new action type with the given TypeSettings

Returns

The resulting action type instance

Parameters
Name Type Description
settings TinyLife.Actions.ActionType.TypeSettings The settings that the action type should have

ActionVariety type

Namespace

TinyLife.Actions

Summary

An action variety is a modification to a ActionType that represents a slightly changed version of the generic action type. Action varieties are used, for example, by PrepareFood to determine the kind of food that should be prepared.

#ctor(name) constructor

Summary

Creates a new action variety with the given name

Parameters
Name Type Description
name System.String The name of this action variety

CanExecute constants

Summary

A function that returns whether or not this action variety can currently be chosen. This is an extension of CanExecute

Description constants

Summary

A function that is called to describe this action variety in more detail. This is used in the menu that pops up when the underlying ActionType is picked.

DisplayName constants

Summary

A function that is called to describe this action variety. This is used in the menu that pops up when the underlying ActionType is picked.

Name constants

Summary

The name of this action variety

PassivePriority constants

Summary

A function that returns the passive priority of this action variety. This is an extension of PassivePriority

AiSettings type

Namespace

TinyLife.Actions.ActionType

Summary

A set of settings that TypeSettings uses to determine how PersonAi should deal with this ActionType

CanDoAtAnyPoint constants

Summary

A value that determines whether or not this action can be started randomly, at any point, by the AI. Whereas CanDoRandomly actions can only be started when the ActionQueue is empty, an action with this flag can always be started randomly. If this value is false, but SolvedNeed is true, this action will still be started if the need set is low. Note that, for this value to have an effect, the PassivePriority needs to be greater than 0.

CanDoRandomly constants

Summary

A value that determines whether or not this action can be started randomly by the AI. A random action will only be started if the corresponding person's ActionQueue is empty. If this value is false, but SolvedNeed is true, this action will still be started if the need set is low. Note that, for this value to have an effect, the PassivePriority needs to be greater than 0.

NeedsFreeActionSpot constants

Summary

A value that determines whether this action needs to find a free ActionSpot on the object that it is invoked on. This value only has an effect if this action can be executed on any Furniture. This value defaults to true.

PassivePriority constants

Summary

A function that returns the passive priority of this action type. By default, the passive priority is 0, meaning this action will never be executed randomly. The higher the passive priority, the more likely it is that this action will be invoked randomly by a person.

SolvedNeed constants

Summary

The need that this action solves when invoked. The action doesn't need to actually solve this need in its implementation, but instead, this value is used to determine which actions to choose from if a person's needs are low. Defaults to null.

CanExecuteDelegate type

Namespace

TinyLife.Actions.ActionType

Summary

A delegate method used for CanExecute

Parameters
Name Type Description
info T:TinyLife.Actions.ActionType.CanExecuteDelegate The action info

CanExecuteResult type

Namespace

TinyLife.Actions.ActionType

Summary

An enumeration that represents whether or not an action can be executed. This is used by CanExecuteDelegate.

Hidden constants

Summary

A result that causes the action to be hidden from the actions menu (and thus be unstartable)

HoldingItem constants

Summary

A result that should be returned when the Person in question is currently holding an item which interferes with the action in some way

NoChair constants

Summary

A result that should be returned when a chair is required for the action, but there is none present

NoSpace constants

Summary

A result that should be returned when the Furniture in question has no space for an item

NotEnoughMoney constants

Summary

A result that should be returned when there is not enough money in the Household to execute this action

NotEnoughSkill constants

Summary

A result that should be returned if the Person in question does not have a skill level high enough to execute this action

NotYours constants

Summary

A result that should be returned if the Person does not own the MapObject that this action is executed on

TooEmbarrassed constants

Summary

A result that should be returned if the Person is considered too embarrassed to do something

TooFar constants

Summary

A result that should be returned if the Person in question is too far away to execute this action

TooSad constants

Summary

A result that should be returned if the Person is considered too sad to do something

TooUncomfortable constants

Summary

A result that should be returned if the Person is considered emotionally too uncomfortable to do something

Valid constants

Summary

A result that causes the action to be executable both by PersonAi and by a player

WrongRelationshipType constants

Summary

A result that should be returned if the Person has the wrong Relationship to a given other person

Car type

Namespace

TinyLife.Objects

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Driver constants

Summary

The id of the person driving the car

Rotation constants

Summary

The rotation that this car has

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CharacterCreator type

Namespace

TinyLife.Uis

Summary

The character creator is displayed when a person (or household) is being edited in terms of their Clothes and PersonalityTypes.

Active property

Summary

The currently displayed CharacterCreator instance, or null if the character editor is closed

CanSwitchPeople() method

Summary

Returns whether or not this character creator instance currently allows switching the selected character. The return value is based on the selected person's FullName and PersonalityTypes.

Returns

Whether we can currently switch the active person

Parameters

This method has no parameters.

CreatePerson(map,household) method

Summary

Creates a new Person instance on the given map with the given lot. The person is placed at the top left corner of the lot. A few settings, like their animation and portrait, are additionally set up.

Returns

The created person instance

Parameters
Name Type Description
map TinyLife.World.Map The map to place the person on
household TinyLife.World.Household The household to add the person to

Open(person,full) method

Summary

Opens a new CharacterCreator for the given person (and their household).

Parameters
Name Type Description
person TinyLife.Objects.Person The person to open in the character creator
full System.Boolean If this value is true, editing the person's name, skin and eye color and personality is possible

Clothes type

Namespace

TinyLife.Objects

Summary

A set of information and a registry for clothing items (and hair) that a Person can wear. Custom clothes can be registered using Register.

#ctor(name,layer,region,colors,icon) constructor

Summary

Creates a new clothes item with the given data

Parameters
Name Type Description
name System.String The name of this clothes item
layer TinyLife.Objects.ClothesLayer The ClothesLayer that this clothes item should render on
region MLEM.Textures.TextureRegion The top left (standing frame 1) TextureRegion that this clothes item uses in the world
colors System.Single The ColorScheme that this clothes item can have its colors selected from
icon MLEM.Textures.TextureRegion The character creator icon for this object, which represents the category / theme / mod that it comes from

Colors constants

Summary

The set of ColorSchemes that this clothes item can have its colors selected from. The color scheme at index i will be mapped to the TextureRegions entry at index i.

Icon constants

Summary

The character creator 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 character creator button for this object.

Layer constants

Summary

The ClothesLayer that this clothes item should render on

Layers constants

Summary

A set of all valid ClothesLayer values

Name constants

Summary

The name of this clothes item. Since this is used for the Types registry, the name must be unique across mods.

TextureRegions constants

Summary

The TextureRegion that this clothes item uses in the world. The texture region specified in the constructor only needs to cover the top left animation frame of the Person, any remaining frames will automatically be gathered. Multiple layers will be gathered if Colors has multiple entries. Each new layer will be gathered to the right of the passed region's area.

Types constants

Summary

A registry that contains all Clothes in the game and all mods

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Register(clothes) method

Summary

Register the given clothes instance to the Types registry

Parameters
Name Type Description
clothes TinyLife.Objects.Clothes The clothes to register

ClothesLayer type

Namespace

TinyLife.Objects

Summary

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.

Body constants

Summary

A clothes layer for the body (the person's skin) itself

Eyes constants

Summary

A clothes layer for eyes

Hair constants

Summary

A clothes layer for hair

Pants constants

Summary

A clothes layer for legwear like pants and skirts

Shirt constants

Summary

A clothes layer for t-shirts, shirts etc.

Shoes constants

Summary

A clothes layer for footwear like shoes

ColorScheme type

Namespace

TinyLife.Utilities

Summary

A color scheme is a list of Color instances with which an object can be colored. By default, a set of color schemes exist (defined in this class), but new ones can be created easily using Create.

Count property

Summary

Stores the amount of Color instances that are part of this color scheme

Item property

Summary

Returns the Color at the given index in this color scheme

Parameters
Name Type Description
index System.Int32 The index to return the color for

Create(objs) method

Summary

Create a new color scheme from the given colors. The colors passed can be of type Color, Int32 or UInt32.

Returns

A new color scheme with the given colors

Parameters
Name Type Description
objs System.Object[] The colors that this color scheme should contain

GetEnumerator() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Load(region) method

Summary

Loads a color scheme from the given texture region. Each pixel on the texture region is evaluated and any pixels with an alpha value greater than zero are added to the color scheme.

Returns

A color scheme with the colors from the texture region

Parameters
Name Type Description
region MLEM.Textures.TextureRegion The texture region to turn into a color scheme

CompletionType type

Namespace

TinyLife.Actions.Action

Summary

An enumeration that represents the various states that an Action can be in.

Active constants

Summary

A completion type that represents an active action

Canceled constants

Summary

A completion type that represents an action that has been canceled by an outside source

Completed constants

Summary

A completion type that represents a completed action

Failed constants

Summary

A completion type that represents an action that has failed to complete

Computer type

Namespace

TinyLife.Objects

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ComputerAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

AndThenInitialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

AndThenOnCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

AndThenUpdate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Constructor type

Namespace

TinyLife.Objects.FurnitureType

Summary

A delegate method used for Construct, which creates a new Furniture instance based on the given furniture type.

Parameters
Name Type Description
id T:TinyLife.Objects.FurnitureType.Constructor The id to apply to the created furniture instance

Cooking type

Namespace

TinyLife.Skills

Summary

The Cooking class holds various options and settings related to the Cooking skill

FoodTypes constants

Summary

All of the FoodType instances that are registered by the game and mods

RegisterFoodType(type) method

Summary

Registers a new FoodType with the given settings

Parameters
Name Type Description
type TinyLife.Skills.Cooking.FoodType The food type to register

CornerFurniture type

Namespace

TinyLife.Objects

Summary

Corner furniture is furniture like SimpleCounter and Hedge that automatically connect to their neighbors

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnNeighborChanged() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldConnectTo(neighbor) method

Summary

This method returns whether this furniture instance should connect to the neighbor furniture. By default, this is only true if the FurnitureType is the same.

Returns

Whether they should connect

Parameters
Name Type Description
neighbor TinyLife.Objects.Furniture The neighbor furniture

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Counter type

Namespace

TinyLife.Objects.CornerFurniture

Summary

A counter is a CornerFurniture that can also connect to objects that have the Stove category

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

ShouldConnectTo() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Cursor type

Namespace

TinyLife.Uis

Summary

The Cursor class contains ways to change the MouseCursor visuals to different CursorType values

SetCursor(type) method

Summary

Sets the currently used cursor to the given CursorType. Note that, every Update frame, the cursor is reset to the default.

Parameters
Name Type Description
type TinyLife.Uis.CursorType The cursor type to set

CursorType type

Namespace

TinyLife.Uis

Summary

An enumeration that defines types of cursor graphics that can be set using SetCursor

Default constants

Summary

The default cursor graphic, which is just an arrow

Disallowed constants

Summary

The disallowed cursor graphic, which is an arrow with a "disallowed" sign next to it

Hammer constants

Summary

The hammer cursor graphic, which is a hammer

None constants

Summary

No cursor

Range constants

Summary

The range cursor graphic, which is an arrow with small green arrows next to it, arranged in a way to signify that a range is edited

Wall constants

Summary

The wall placement cursor graphic, which is an arrow with a little wall next to it

DeathReason type

Namespace

TinyLife.Objects.Person

Summary

An enum that represents a set of possible reasons for a Person's death

InexplicableReasons constants

Summary

A death reason that represents that a person died from an unknown reason. This is only used by the "Die" cheat.

Starvation constants

Summary

A death reason that represents that a person died from hunger. This value is used by StarveAction.

Door type

Namespace

TinyLife.World

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

CanWalkThrough() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

DrawEvent`1 type

Namespace

TinyLife.Mods.Events

Summary

A delegate used by events that are invoked when something is drawn. This event has no EventPhase attached to it, since drawing is done in a sorted fashion anyway.

Parameters
Name Type Description
obj T:TinyLife.Mods.Events.DrawEvent`1 The object being updated
Generic Types
Name Description
T The type of object that the event is being invoked for

DriveAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

FindPath() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetSpeed() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnPathReady() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Emote type

Namespace

TinyLife.Actions

Summary

An emote is a graphic that can be displayed in a bubble over a Person, usually as part of a conversation.

#ctor(texture,categories) constructor

Summary

Initializes a new emote with the given settings

Parameters
Name Type Description
texture MLEM.Textures.TextureRegion The texture that this emote should display
categories TinyLife.Actions.EmoteCategory The categories that this emote should have. Can be a combined flag.

AllCategories constants

Summary

A set of all valid EmoteCategory values

Categories constants

Summary

A combined EmoteCategory flag that determines the categories that this emote belongs to

Texture constants

Summary

The texture that is displayed for this emote

GetEmotes(possibleCategories) method

Summary

Returns a set of all of the emotes in the given combined category flag

Returns

A set of all emotes that match the categories

Parameters
Name Type Description
possibleCategories TinyLife.Actions.EmoteCategory The categories

GetRandomEmote(possibleCategories) method

Summary

Returns a random emote from a combined flag of possible categories

Returns

A random emote from the given categories

Parameters
Name Type Description
possibleCategories TinyLife.Actions.EmoteCategory The possible categories

Register(emote) method

Summary

Registers a new Emote with the given settings

Parameters
Name Type Description
emote TinyLife.Actions.Emote The emote to register

EmoteCategory type

Namespace

TinyLife.Actions

Summary

A flag enumeration that represents the types of Emote that are available

Flirty constants

Summary

An emote category that represents sex related or suggestive emotes

General constants

Summary

An emote category that represents emotes for general conversations

Negative constants

Summary

An emote category that represents negative emotes

Travel constants

Summary

An emote category that represents travel-related emotes

EmotionModifier type

Namespace

TinyLife.Emotions

Summary

An emotion modifier stores information about a Person's current or past actions or events that influenced their Emotion in some way. Each emotion modifier contributes to the person's emotion, and the emotion modifier with the highest combined Amount determines the person's Emotion. Emotion modifiers can be applied automatically using Condition or manually using AddEmotion.

#ctor(name,icon,emotion,condition) constructor

Summary

Creates a new emotion modifier with the given settings

Parameters
Name Type Description
name System.String The modifier's name
icon MLEM.Textures.TextureRegion The modifier's icon
emotion TinyLife.Emotions.EmotionType The modifier's resulting emotion type
condition System.Func{TinyLife.Objects.Person,System.Int32} An optional condition for this modifier

Condition constants

Summary

An (optional) condition that has to be met for this emotion modifier to be applied to a person. If this value is non-null, and the value returned by this function is greater than zero, this emotion modifier will be applied to a Person with the Amount set to the return value. If this value is not set, the emotion modifier has to be applied manually using AddEmotion.

Emotion constants

Summary

The EmotionType that this emotion modifier causes (if the Amount is high enough)

Icon constants

Summary

This emotion modifier's icon which will be displayed in the emotions menu

Name constants

Summary

This emotion modifier's name

Types constants

Summary

A registry that contains all EmotionModifier instances from the game and mods

Register(modifier) method

Summary

Registers the given emotion type into the Types registry

Returns

The modifier, for chaining

Parameters
Name Type Description
modifier TinyLife.Emotions.EmotionModifier The modifier to register

EmotionType type

Namespace

TinyLife.Emotions

Summary

An emotion type is a type of feeling that a Person can have. The emotion that a person has results from that person's applied EmotionModifierInstances.

#ctor(name,icon,color,category) constructor

Summary

Creates a new emotion type with the given settings

Parameters
Name Type Description
name System.String The emotion type's name
icon MLEM.Textures.TextureRegion The emotion type's icon
color Microsoft.Xna.Framework.Color The emotion type's color
category TinyLife.Emotions.EmotionType.TypeCategory This emotion type's category

Category constants

Summary

The TypeCategory that this emotion type fits into. The category is used for ordering and organizing EmotionModifier instances.

Color constants

Summary

The color that represents this emotion. The color is used as a backdrop for EmotionModifier instances of this type.

Icon constants

Summary

This emotion's icon, which is used in the portrait section for a Person that has this emotion

Name constants

Summary

This emotion's name

Types constants

Summary

A registry of all EmotionType instances from the game and mods

Register(type) method

Summary

Registers the given emotion type to the Types registry

Returns

The passed type, for chaining

Parameters
Name Type Description
type TinyLife.Emotions.EmotionType The type to register

EventPhase type

Namespace

TinyLife.Mods

Summary

An enumeration that represents the phases that an Events event can be invoked in

Post constants

Summary

A phase that represents an event that is invoked after something happens

Pre constants

Summary

A phase that represents an event that is invoked before something happens

Events type

Namespace

TinyLife.Mods

Summary

A set of events that can be subscribed to by mods to allow for special handling of certain situations. To have more events added to this list if they're required by your mods, please reach out to Ellpeck. Note that, for events that use an EventPhase, the subscriber needs to make sure that the code only runs for one of the phases, and not both, by checking the current phase.

ExportedHousehold type

Namespace

TinyLife.World

Summary

This class represents an exported version of a Household, storing all of the Map-independent data.

Members constants

Summary

The Person instances that are members of this household

Money constants

Summary

The money that this household has

ExportedLot type

Namespace

TinyLife.World

Summary

An exported lot is all of the relevant data of a Lot that should be exported to a file when clicking the "Export" button in the build menu. To create an exported lot from a lot, use Export.

Area constants

Summary

The area that this lot covers in the world

Furniture constants

Summary

The Furniture that is present on this lot

Roofs constants

Summary

The roofs that are present on this lot

Tiles constants

Summary

The ground tiles of this lot

Type constants

Summary

This lot's LotType

Walls constants

Summary

The walls that are present on this lot

GetCoveredArea() method

Summary

Returns a RectangleF that represents the area that this lot actually covers. The area covered by this lot is always bounded by its Area, but will be smaller if there are fewer objects on the lot.

Returns

The area that this lot covers

Parameters

This method has no parameters.

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Extensions type

Namespace

TinyLife.Utilities

Summary

A set of extensions for dealing with various things required by Tiny Life.

And(result,other) method

Summary

A helper method to return Valid only if both passed CanExecuteResult values are Valid. If this is not the case, the validity of the result is returned if it is not Valid, and otherwise, the validity of the other is returned.

Returns

The validity of both results

Parameters
Name Type Description
result TinyLife.Actions.ActionType.CanExecuteResult The first result
other TinyLife.Actions.ActionType.CanExecuteResult The second result

GetDecorativeRating(quality) method

Summary

Returns the decorative rating of an object with the given Quality. The returned values are as follows: Terrible: -2, Good: 1, Great: 1, Perfect: 2, Masterpiece: 3, Else: 0.

Returns
Parameters
Name Type Description
quality TinyLife.Skills.Quality

GetOpposite(type) method

Summary

Returns the opposite of the given GenealogyType. The "opposite" is the relationship that the other partner of this GenealogyType will have. For example, the opposite of Parent is Child and vice versa.

Returns

The genealogy type's opposite

Parameters
Name Type Description
type TinyLife.GenealogyType The genealogy type

GetPriceModifier(quality) method

Summary

Returns a multiplier that an object's price should be multiplied with based on the given Quality.

Returns

The price modifier for the object

Parameters
Name Type Description
quality TinyLife.Skills.Quality The object's quality

IsVertical(dir) method

Summary

Returns whether the passed direction is considered vertical. A vertical direction is Up and Down. All other directions return false.

Returns

Whether or not the direction is vertical

Parameters
Name Type Description
dir MLEM.Misc.Direction2 The direction to check verticalness for

JsonCopy``1(obj) method

Summary

Copies the given object using the Serializer.

Returns

A copy of the object

Parameters
Name Type Description
obj ``0 The object to copy
Generic Types
Name Description
T The type of the object

RotateBy(dir,reference,start) method

Summary

Rotates the given direction by a given reference direction.

Returns

The direction, rotated by the reference direction

Parameters
Name Type Description
dir MLEM.Misc.Direction2 The direction to rotate
reference MLEM.Misc.Direction2 The direction to rotate by
start MLEM.Misc.Direction2 The direction to use as the default direction, Up by default

ToLocalizedString(quality) method

Summary

Returns a localized string for the given Quality.

Returns

A localized string representing the quality

Parameters
Name Type Description
quality TinyLife.Skills.Quality The quality

ToScreenPos(position,center) method

Summary

Converts the given world-space position into a draw-space position

Returns

The draw-space position

Parameters
Name Type Description
position Microsoft.Xna.Framework.Vector2 The position to convert
center System.Boolean If this is true, the position will be offset by half a tile, centering it on the screen

ToSellingPriceString(value) method

Summary

Returns a string of the structure "$0.##" that displays the given value as a price in dollars.

Returns

The price as a string

Parameters
Name Type Description
value System.Single The price

ToWallSide(dir) method

Summary

Returns an integer that represents the given Direction2 as a side of a Wall. Specifically, Up and Left return 0, any other directions return 1.

Returns

The corresponding wall side

Parameters
Name Type Description
dir MLEM.Misc.Direction2 The direction to convert into a wall side

ToWorking(pose) method

Summary

Converts the given Pose to a version in which a person is looking as if they were working on something. For all standing poses, this returns WorkingStanding, and for all sitting poses, WorkingSitting is returned.

Returns

The working version of the given pose

Parameters
Name Type Description
pose TinyLife.Objects.Person.Pose The pose to convert to a working pose
Exceptions
Name Description
System.ArgumentOutOfRangeException If the given pose does not have a working version

ToWorldPos(position) method

Summary

Converts the given draw-space position into a world-space position

Returns

The world-space position

Parameters
Name Type Description
position Microsoft.Xna.Framework.Vector2 The position to convert

Fence type

Namespace

TinyLife.Objects

Summary

A fence is a furniture used by things like CountryFence that auto-connects similarly to CornerFurniture, but by actually adding additional connection textures onto the regular object textures

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnNeighborChanged() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldConnectTo(neighbor) method

Summary

This method returns whether this furniture instance should connect to the neighbor furniture. By default, this is only true if the FurnitureType is the same.

Returns

Whether they should connect

Parameters
Name Type Description
neighbor TinyLife.Objects.Furniture The neighbor furniture

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Food type

Namespace

TinyLife.Objects

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

FoodLeft constants

Summary

The amount of food that this food item has left. This is set to FoodAmount by default

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetHoverInfo() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

FoodType type

Namespace

TinyLife.Skills.Cooking

Summary

A food type is a type of dish that can be cooked using GetIngredients. Food types store information such as their name and texture, but also the cooking level that is required to make them.

#ctor(name,requiredCookingLevel,price,foodAmount) constructor

Summary

Creates a new food type with the given settings

Parameters
Name Type Description
name System.String The food type's name
requiredCookingLevel System.Int32 The required cooking skill level
price System.Int32 The price to prepare this food type
foodAmount System.Int32 The amount of food points that this food gives

FoodAmount constants

Summary

The amount of food points that this food gives. This is passed to FoodLeft when a dish is created. For reference, the mac and cheese dish has a food amount of 100.

Name constants

Summary

This food type's name

Price constants

Summary

The price that creating this food type has

RequiredCookingLevel constants

Summary

The level of the Cooking skill that is required to prepare this dish

Texture constants

Summary

This food type's texture region. Since the plate will automatically be rendered below this food type, the texture only needs to contain the dish itself.

FoodTypedItem type

Namespace

TinyLife.Objects

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Creator constants

Summary

The Guid of the Person that created this item

FoodType constants

Summary

The FoodType that this food-typed item has

GetHoverInfo() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Furniture type

Namespace

TinyLife.Objects

Summary

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.

#ctor(id,type,colors,map,pos) constructor

Summary

Creates a new furniture instance. By default, this is done using Constructor.

Parameters
Name Type Description
id System.Guid The id to apply to the created furniture instance
type TinyLife.Objects.FurnitureType The type to create an instance of
colors System.Int32[] The colors to apply to the furniture
map TinyLife.World.Map The map to create the furniture on
pos Microsoft.Xna.Framework.Vector2 The position that the furniture should have

Colors constants

Summary

The indices of the colors that this furniture has. Refer to ColorSchemes for the actual colors that these indices represent.

Rotation constants

Summary

The current rotation of this furniture. Since furniture has a wide variety of looks, the specific value of the rotation doesn't necessarily have much practical meaning.

Type constants

Summary

The FurnitureType that this furniture has

Area property

Summary

A RectangleF that represents the area that this furniture piece is currently taking up, based on its GetSize and its Position

ParentFurniture property

Summary

The Furniture that this furniture is currently latched on to. If this value is non-null, ParentObjectSpot returns the object spot that this furniture is in.

ParentObjectSpot property

Summary

The ObjectSpot that this furniture is currently in. If this value is non-null, ParentFurniture returns the furniture that this object spot belongs to.

AddChild(item,rotation) method

Summary

Adds a child to this furniture, setting its parent (SetParent) to this furniture. The object spot selected is the first available object spot.

Returns

If there was a free object spot to add the furniture to

Parameters
Name Type Description
item TinyLife.Objects.Furniture The furniture to add as the child
rotation MLEM.Misc.Direction2 The rotation that the furniture should have, can be the same as the previous rotation

AddChild``1(type,rotation,colors,id) method

Summary

Adds a child to this furniture, setting its parent (SetParent) to this furniture.

Returns

The child that was added, or null if it doesn't match the type specified

Parameters
Name Type Description
type TinyLife.Objects.FurnitureType The type of furniture to construct as the child
rotation MLEM.Misc.Direction2 The desired rotation of the child furniture
colors System.Int32[] The colors that the child should have
id System.Nullable{System.Guid} The id that the child should have, random by default
Generic Types
Name Description
T The type of furniture that the child is

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Draw(time,batch,pos,drawPos,overrideColor,rotation,colors,drawScale,pivot,parent,parentSpot,depthOffset) method

Summary

Draws this furniture in the world with the given settings. This is a more generalized version of Draw

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to draw with
pos Microsoft.Xna.Framework.Vector2 The position, in world space, that the furniture is at
drawPos Microsoft.Xna.Framework.Vector2 The position, in draw space, to draw the furniture at
overrideColor System.Nullable{Microsoft.Xna.Framework.Color} An optional color to override the default colors of the furniture
rotation MLEM.Misc.Direction2 The rotation of the furniture
colors System.Int32[] The colors to draw the furniture with
drawScale System.Single The scale to draw the furniture with
pivot System.Boolean Whether or not to move the furniture by its texture's pivot point
parent TinyLife.Objects.Furniture The object that this furniture is latched on to, or null if there is none
parentSpot TinyLife.Objects.ObjectSpot The object spot that this furntiture is in, or null if there is none
depthOffset System.Single A value that is added onto the calculated depth of the object

DrawUi(time,batch,element,drawScale,colors) method

Summary

Draws this furniture in a ui context, rather than a world context. Scale is determined based on the element that is passed.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current game time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to draw with
element MLEM.Ui.Elements.Element The element to calculate scaling based on
drawScale System.Single The scale to draw the furniture with
colors System.Int32[] The colors to draw the furniture with

GetAiPriority() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetCategories() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetChildren``1() method

Summary

Returns a list of all of the children of this furniture. Children are all furnitures in the world that have their ParentFurniture set to this furniture instance.

Returns

A list of this furniture's children

Parameters

This method has no parameters.

GetFreeActionSpot(person,context) method

Summary

Returns the first free action spot from GetFreeActionSpots.

Returns

A free action spot and the direction it's free in, or an empty tuple if there is no free action spot

Parameters
Name Type Description
person TinyLife.Objects.Person The person to query free action spots for
context TinyLife.Objects.ObjectCategory The object category that this action spot needs to have

GetFreeActionSpotInfo(person,context) method

Summary

Returns the first free action spot from GetFreeActionSpot, but packed into an ActionInfo.

Returns

The first free action spot as an ActionInfo

Parameters
Name Type Description
person TinyLife.Objects.Person The person to query free action spots for
context TinyLife.Objects.ObjectCategory The object category that this action spot needs to have

GetFreeActionSpots(person,context) method

Summary

Returns a list of ActionSpot instances that are part of this furniture, which are considered free. Free, in this instance, is any spot that has the given category and is not currently occupied by another person.

Returns

A set of action spots and the directions which they're free in

Parameters
Name Type Description
person TinyLife.Objects.Person The person to query free action spots for
context TinyLife.Objects.ObjectCategory The object category that this action spot needs to have

GetFreeObjectSpot(type) method

Summary

Returns the first free ObjectSpot on this furniture. Free, in this case, is any object spot that isn't already occupied by a different furniture.

Returns

A free object spot, or null if there is none

Parameters
Name Type Description
type TinyLife.Objects.FurnitureType The furniture type to find a free object spot for

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Intersects() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnAdded() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnNeighborChanged(neighbor) method

Summary

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

Parameters
Name Type Description
neighbor TinyLife.Objects.Furniture The neighbor furniture that changed

OnRemoved() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

RemoveChildren``1(predicate) method

Summary

Removes all of the children from this furniture that match the given predicate. Children are all furnitures in the world that have their ParentFurniture set to this furniture instance.

Returns

The children that were removed from this furniture

Parameters
Name Type Description
predicate System.Predicate{``0} The predicate to check children against. If null, all children will be removed.
Generic Types
Name Description
T The type of children to remove

SetChild(spot,type,rotation,colors,id) method

Summary

Sets the child element in the given object spot to the given furniture. If there are already children in the given object spot, those are removed prior to adding the new child.

Parameters
Name Type Description
spot TinyLife.Objects.ObjectSpot The spot to add the child to
type TinyLife.Objects.FurnitureType The type of furniture to construct as the child
rotation MLEM.Misc.Direction2 The desired rotation of the child furniture
colors System.Int32[] The colors that the child should have
id System.Nullable{System.Guid} The id that the child should have, random by default

SetChild(spot,item,rotation) method

Summary

Sets the child element in the given object spot to the given furniture. If there are already children in the given object spot, those are removed prior to adding the new child.

Parameters
Name Type Description
spot TinyLife.Objects.ObjectSpot The spot to add the child to
item TinyLife.Objects.Furniture The furniture to add to the spot
rotation MLEM.Misc.Direction2 The desired rotation of the child furniture

SetParent(parent,spot) method

Summary

Sets the parent of this furniture, changing its Position and settings its ParentObjectSpot value.

Parameters
Name Type Description
parent TinyLife.Objects.Furniture The parent furniture to slot into
spot TinyLife.Objects.ObjectSpot The object spot to slot into

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

FurniturePlacer type

Namespace

TinyLife.Tools

Summary

A helper class that represents a tool part which allows the placement and movement of furniture objects. This class is used by FurnitureTool and MoveTool.

SelectedColors property

Summary

The color indices that are currently selected for the SelectedFurniture

SelectedFurniture property

Summary

The FurnitureType that is currently selected for placement

SelectedPreview property

Summary

An instance of the SelectedFurniture

Draw(time,batch) method

Summary

Draws the SelectedPreview of this furniture placer

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing

ForceWallsUp() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetMouseCursor() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

HighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

SelectFurniture(furniture,preview,variation,rotation,colors,exact) method

Summary

Selects the given FurnitureType. If exact is enabled, the preview is the exact furniture instance that will be placed. If it is false, a new instance of the given furniture will be created upon placement.

Parameters
Name Type Description
furniture TinyLife.Objects.FurnitureType The furniture type to select
preview TinyLife.Objects.Furniture An instance of the given furniture
variation System.Action{TinyLife.Objects.Furniture} A function that represents a furniture variation to place
rotation MLEM.Misc.Direction2 The rotation to select
colors System.Int32[] The colors to select
exact System.Boolean Whether or not the preview is the exact instance that should be placed

Update() method

Summary

Updates this furniture placer. This should be called in Update each frame.

Parameters

This method has no parameters.

FurnitureTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ForceWallsUp() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetMouseCursor() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

InitBuildModeUi() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

FurnitureType type

Namespace

TinyLife.Objects

Summary

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.

Textures constants

Summary

The textures that this furniture type has. Each texture is automatically loaded based on the registered 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.

Types constants

Summary

A list of all available furniture types. Register furniture types using Register.

ReferenceTexture property

Summary

A reference texture that is used for visual size calculations. Always returns the first available texture of DefaultRotation in Textures

Rotations property

Summary

The valid rotations that this furniture has, which are automatically determined based on the available Textures

Settings property

Summary

This furniture type's settings

AreWallsInTheWay(map,pos,rotation) method

Summary

Returns whether or not there would be walls in the way if this furniture type was placed at the given position with the given rotation

Returns

Whether there are walls in the way if the furniture gets placed in this location

Parameters
Name Type Description
map TinyLife.World.Map The map to place the furniture on
pos Microsoft.Xna.Framework.Vector2 The position that the furniture should be placed at
rotation MLEM.Misc.Direction2 The rotation that the furniture should have

Construct(colors,map,pos,id) method

Summary

Constructs a new Furniture object from this furniture type

Returns

A new furniture instance of this type

Parameters
Name Type Description
colors System.Int32[] The indices of the colors that the furniture should have
map TinyLife.World.Map The map that the furniture should be added to
pos Microsoft.Xna.Framework.Vector2 The position that the furniture should have
id System.Nullable{System.Guid} The id that the furniture should have, or a random one by defualt

DrawColumns(map,position,rotation,batch,drawPos,texture,color,scale,size,pivot,parent,spot,depthOffset,mirror,wallHanging,groundItem) method

Summary

Draws the given texture region in columns, which allows for depth calculation in isometric view to be possible. Bigger objects, including all furniture, are drawn in this matter.

Parameters
Name Type Description
map TinyLife.World.Map The map that the object is on
position Microsoft.Xna.Framework.Vector2 The position that the object is on, in world space
rotation MLEM.Misc.Direction2 The rotation that this object has, used for some calculations
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to draw with
drawPos Microsoft.Xna.Framework.Vector2 The position to draw at, in draw space
texture MLEM.Textures.TextureRegion The texture region to draw
color Microsoft.Xna.Framework.Color The color to draw with
scale System.Single The scale to draw at
size Microsoft.Xna.Framework.Point The size, in tiles, that this object has
pivot System.Boolean Whether or not the object should be translated by the texture's pivot point
parent TinyLife.Objects.Furniture The object's parent object
spot TinyLife.Objects.ObjectSpot The object's parent spot
depthOffset System.Single A value that is added to the calculated object's depth
mirror System.Boolean Whether or not to mirror the texture
wallHanging System.Boolean Whether or not this object is hanging on a wall
groundItem System.Boolean Whether or not this item is considered a ground item (that doesn't have any collisions)

DrawLayers(map,position,batch,drawPos,rotation,layers,colors,scale,pivot,parent,spot,overrideColor,depthOffset) method

Summary

Draws the furniture type with the given data

Parameters
Name Type Description
map TinyLife.World.Map The map to draw the furniture type on
position Microsoft.Xna.Framework.Vector2 The position on the map that the furniture is at
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch used for drawing
drawPos Microsoft.Xna.Framework.Vector2 The position that this furniture should be drawn at on the screen
rotation MLEM.Misc.Direction2 The rotation of the furniture
layers MLEM.Textures.TextureRegion[] The textures to draw this furniture with
colors System.Int32[] The indices in the ColorSchemes that the furniture should be drawn with
scale System.Single The scale that the furniture should be drawn with
pivot System.Boolean Whether or not the furniture should be shifted by its pivot point
parent TinyLife.Objects.Furniture The parent that the furniture is attached to. Can be null.
spot TinyLife.Objects.ObjectSpot The object spot that the furniture is on, or null if there is no parent
overrideColor System.Nullable{Microsoft.Xna.Framework.Color} The color that should be used to draw this furniture instead of colors
depthOffset System.Single A value that is added to the depth calculation for drawing this furniture type

GetColumns(rotation) method

Summary

Returns the amount of columns that this furniture should be drawn in, based on the given rotation.

Returns

The amount of columns to draw

Parameters
Name Type Description
rotation MLEM.Misc.Direction2 The rotation

GetCoveredTiles(pos,size) method

Summary

Returns a rectangle that contains all of the tiles which intersect with the furniture when placed at the given position, with the given size.

Returns

A rectangle with all of the tiles that are covered

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Vector2 The position to place the furniture at
size Microsoft.Xna.Framework.Point The size of the furniture

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetSize(rotation) method

Summary

Returns the Size of this furniture type, modified based on the given rotation.

Returns

The modified size

Parameters
Name Type Description
rotation MLEM.Misc.Direction2 The rotation to return the size for

GetTexture(name) method

Summary

Returns a TextureRegion with the given name, based on all of the textures in the base game and all GetCustomFurnitureTextures textures.

Returns

A texture region with the given name, or null if there is none

Parameters
Name Type Description
name System.String The name of the texture to get

GetTextures(name,amount) method

Summary

Create a dictionary of textures for all Adjacent directions that have a texture registered for them. Textures are gathered using GetCustomFurnitureTextures, and textures need to be suffixed with the direction's string to be recognized. This method is used for furniture of all kinds.

Returns

A dictionary of directions to texture layers

Parameters
Name Type Description
name System.String The name of the texture to load
amount System.Int32 The amount of layers the texture has

GetWallsInTheWay(map,pos,rotation) method

Summary

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

Returns

A set of walls that would be in the way

Parameters
Name Type Description
map TinyLife.World.Map The map to place the furniture on
pos Microsoft.Xna.Framework.Vector2 The position that the furniture should be placed at
rotation MLEM.Misc.Direction2 The rotation that the furniture should have

HasCategory(category) method

Summary

Returns whether this type's Settings have any of the supplied ObjectCategory values

Returns

Whether the category is present

Parameters
Name Type Description
category TinyLife.Objects.ObjectCategory The category to query

Register(settings) method

Summary

Register a custom furniture type.

Returns

The registered furniture type

Parameters
Name Type Description
settings TinyLife.Objects.FurnitureType.TypeSettings The settings to apply to the custom furniture type

GameImpl type

Namespace

TinyLife

Summary

The main class for Tiny Life, which houses a set of important game-wide properties.

CurrentTime constants

Summary

The current in-game total time since the start of the game.

FollowingPerson constants

Summary

The Person that the camera is currently locked onto

Camera property

Summary

The game's in-world camera, created in LoadContent

CurrentHousehold property

Summary

The household that is currently being played, or

null

if in the main menu, editing a lot or on the map select screen

CurrentLot property

Summary

The lot that is currently being played on or edited, or

null

if in the main menu or on the map select screen

CurrentTool property

Summary

The Tool that is currently selected. Should always be set to either PlayModeTool or any of BuildTools.

GraphicsMetrics property

Summary

The game's graphics metrics, gathered at the end of every DoDraw call

Instance property

Summary

The game's singleton instance

Listener property

Summary

The game's AudioListener that is automatically moved to the Camera's position

Map property

Summary

The map that the game is currently on, or

null

if in the main menu

Mode property

Summary

The GameMode that is currently active

Money property

Summary

The money that the CurrentHousehold has, or MaxValue if there is no active household

SaveName property

Summary

The name of the save file that is currently being played, or

null

if in the main menu

Speed property

Summary

The current GameSpeed. Note that, if the current speed is VeryFast and the game CanBeExtremelyFast, ExtremelyFast is returned.

Weekday property

Summary

The current in-game weekday, based on CurrentTime

CanBeExtremelyFast() method

Summary

Returns whether the game allows changing the speed to ExtremelyFast at the current time. If this returns true, and Speed is set to VeryFast, the ExtremelyFast speed is automatically engaged.

Returns

Whether the game can become extremely fast

Parameters

This method has no parameters.

CanSaveOrSwitchModes() method

Summary

Returns whether the game can currently save or if SwitchGameMode is allowed to be used right now. The return value is influenced by CanSaveOrSwitchModes and AreRequirementsMet.

Returns

Whether we can save or switch modes right now

Parameters

This method has no parameters.

DoDraw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

DoUpdate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

IsMouseOnUi() method

Summary

Returns true if the mouse is currently on top of any ui element in the UiSystem

Returns

true if the mouse is currently on top of any element

Parameters

This method has no parameters.

LoadContent() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

SwitchGameMode(mode) method

Summary

Switches the game mode to the given mode, and sets up all of the required data. Note that some game modes require certain data to be set prior to calling this method.

Parameters
Name Type Description
mode TinyLife.GameImpl.GameMode The game mode to switch to

GameMode type

Namespace

TinyLife.GameImpl

Summary

An enumeration that contains values representing the different game modes the game can be in

BuildOnly constants

Summary

A game mode that represents the play mode forced to build mode (with no current household)

InGameHousehold constants

Summary

A game mode that represents the play mode, either in-game or in build mode

MainMenu constants

Summary

A game mode that represents the main menu

SelectHousehold constants

Summary

A game mode that represents the map selection menu

GameSpeed type

Namespace

TinyLife

Summary

An enumeration of all possible game speeds. The value of each value is the amount that the game's speed is multiplied with.

ExtremelyFast constants

Summary

A game speed with which things happen at 20 times the Regular speed. Note that this option is not selectable and only occurs if every household member is asleep or out of town.

Fast constants

Summary

A game speed with which things happen at twice the Regular speed

Paused constants

Summary

A game speed that represents no actions occuring

Regular constants

Summary

A game speed that represents the regular speed

VeryFast constants

Summary

A game speed with which things happen at three times the Regular speed

GenealogyType type

Namespace

TinyLife

Summary

An enumeration that represents the type that a Relationship's genealogy can have. Note that these typs are deliberately gender-neutral.

Child constants

Summary

A genealogy type that represents a child of a Parent

Grandchild constants

Summary

A genealogy type that represents a grandchild of a Grandparent

Grandparent constants

Summary

A genealogy type that represents a grandparent of a Grandchild

Nibling constants

Summary

A genealogy type that represents a nibling (niece or nephew) of a Pibling

Parent constants

Summary

A genealogy type that represents a parent of a Child

Pibling constants

Summary

A genealogy type that represents a pibling (aunt or uncle) or a Nibling

Sibling constants

Summary

A genealogy type that represents a sibling

Unrelated constants

Summary

A genealogy type that represents two unrelated people

GetAndSitDownAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

AndThenInitialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

AndThenUpdate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CreateFirstActions() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetChair() method

Summary

A helper method that returns the chair that this action is related to. If there is no chair found, null is returned.

Returns

The chair, or null if there is none

Parameters

This method has no parameters.

GetIconObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetInteractingItem``1() method

Summary

A helper method that returns the item instance that is currently being interacted with in this action. Since this action type is rather complex, this is the favored way over GetActionObject``1.

Returns

The object, or null if there is none

Parameters

This method has no parameters.

Generic Types
Name Description
T The type that the object is expected to be

GetNextAction() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GoHereAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

AndThenInitialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

AndThenIsCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CanCancel() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CreateFirstActions() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldFail() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Gravestone type

Namespace

TinyLife.Objects

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Reason constants

Summary

The DeathReason for this gravestone's DeadPerson's death

DeadPerson property

Summary

The Person that is "stored" in this gravestone. Note that the actual dead person is stored in GetDeadPerson.

GetHoverInfo() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Household type

Namespace

TinyLife.World

Summary

A household is a set of Person instances that live together on the same Lot

#ctor(map,lot) constructor

Summary

Creates a new household on the given map and lot

Parameters
Name Type Description
map TinyLife.World.Map The map that this household is on
lot TinyLife.World.Lot The lot that this household should own (can be null)

IsCurrent property

Summary

A property that indicates whether or not this household is the same as CurrentHousehold

Lot property

Summary

The Lot that this household lives on. For exported households, this might be null.

Members property

Summary

The Person instances that are members of this household

Money property

Summary

The money that this household has, rounded by two digits after the decimal point

Name property

Summary

The name of this household. The name of a household is the LastName that most people in this household have.

Add(person) method

Summary

Adds the given person to this household

Parameters
Name Type Description
person TinyLife.Objects.Person The person to add

Export() method

Summary

Exports this household's data into an ExportedHousehold, which can be saved to disk independently of the Map that this household is on.

Returns

An exported household

Parameters

This method has no parameters.

GetAverageFriendshipTo(person) method

Summary

Returns the average friendship level that the given Person has with members of this lot. This method returns an averaged value of the FriendLevel that this person has towards each member of this lot.

Returns

The average friendship level, out of Max

Parameters
Name Type Description
person TinyLife.Objects.Person The person to query

HasMember(person) method

Summary

Returns whether the given person is a part of this household

Returns

true if the person is part of this household, false otherwise

Parameters
Name Type Description
person TinyLife.Objects.Person The person to query

Import(household) method

Summary

Imports the given ExportedHousehold into this household. Note that existing Members are not removed or replaced beforehand.

Parameters
Name Type Description
household TinyLife.World.ExportedHousehold The household to import

IsLotVisible(lot) method

Summary

Returns whether the given lot is considered visible to this household Note that passing this household's Lot will always cause this method to return true.

Returns

Whether the lot is visible

Parameters
Name Type Description
lot TinyLife.World.Lot The lot to query

MarkLotNonVisible(lot) method

Summary

Marks a lot non-visible if it's currently visible.

Parameters
Name Type Description
lot TinyLife.World.Lot The lot to remove visibility for

MarkLotVisible(lot) method

Summary

Marks the given lot as visible for members of this household. VisitLot should be used in favor of this method in most cases. By default, visibility lasts for 30 seconds of real time.

Parameters
Name Type Description
lot TinyLife.World.Lot The lot to mark as visible

Remove(person) method

Summary

Removes the given person from this household, if they're part of it

Parameters
Name Type Description
person TinyLife.Objects.Person The person to remove

Update(time,passedInGame,speed) method

Summary

Updates this household, ticking down the lot visibility times

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
passedInGame System.TimeSpan The amount of time passed in game
speed TinyLife.GameSpeed The game's speed

Validate() method

Summary

This method is called when this object is loaded from disk.

Returns

false if the object is not valid, true otherwise

Parameters

This method has no parameters.

IPricedObject type

Namespace

TinyLife.World

Summary

A priced object is an object that has a floating point price value attached to it. In the world of Tiny Life, prices are written as "tiny bucks", but they don't necessarily resemble the prices of the American dollar.

GetPrice() method

Summary

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.

Returns

The object's price

Parameters

This method has no parameters.

IUpdatingObject type

Namespace

TinyLife.Objects

Summary

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.

Update(time,passedInGame,speed) method

Summary

The update method, which is called every update frame by the underlying Map

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
passedInGame System.TimeSpan The amount of time that has passed since the last call
speed TinyLife.GameSpeed The game's speed

Instance type

Namespace

TinyLife.Emotions.EmotionModifier

Summary

This class represents an applied instance of a EmotionModifier. It is used by AddEmotion.

#ctor(type,amount,time) constructor

Summary

Creates a new EmotionModifier instance with the given settings

Parameters
Name Type Description
type TinyLife.Emotions.EmotionModifier The emotion modifier of this instance
amount System.Int32 The amount that this instance should yield
time System.TimeSpan The time that this instance should last for

Amount constants

Summary

The amount that this emotion modifier's Type has

TotalTime constants

Summary

The total amount of in-game time that this emotion modifier lasts for

Type constants

Summary

The emotion modifier that this instance contains

Time property

Summary

The amount of in-game time remaining of this modifier, out of TotalTime

PassTime(passedInGame) method

Summary

Causes Time to pass by the given TimeSpan. If Time is equal to MaxValue, nothing happens.

Parameters
Name Type Description
passedInGame System.TimeSpan The amount of time that should pass

Job type

Namespace

TinyLife.Goals

Summary

A job is a kind of work that a Person can have. The person's current job is accessible using Job. A job instance is constructed from its underlying JobType.

#ctor(type,person) constructor

Summary

Creates a new job from the given settings

Parameters
Name Type Description
type TinyLife.Goals.JobType The underlying job type
person TinyLife.Objects.Person The person that should have this job

Type constants

Summary

The underlying JobType that this job results from

CurrentHourlyPay property

Summary

The amount of tiny bucks that this job pays per hour. This is based on HourlyPay and the current Level.

Level property

Summary

The current level that this job is at. Note that the default level is 0, and the level goes up to a maximum of 9.

Performance property

Summary

This job's current performance, ranging from 0 to 1, representing the percentage of work performance. The default value is 0.5.

Person property

Summary

The Person that currently has this job

AddLevel(level) method

Summary

Adds (or removes) the given amount of levels to this job's Level. Note that the level value is automatically clamped between 0 and 9, inclusively.

Parameters
Name Type Description
level System.Int32 The level to add to this job's current level

AddPerformance(performance) method

Summary

Adds (or removes) the given amount of performance to this job's Performance. If the total Performance rolls over (below 0 or above 1), AddLevel is called and the performace is reset accordingly.

Parameters
Name Type Description
performance System.Single The amount to add or remove to the current performance

Update(passedInGame) method

Summary

Updates this job, changing the Performance and Level according to this job's person's current actions. This is called in Update.

Parameters
Name Type Description
passedInGame System.TimeSpan The amount of time that has passed in game since the last update

Validate() method

Summary

This method is called when this object is loaded from disk.

Returns

false if the object is not valid, true otherwise

Parameters

This method has no parameters.

JobType type

Namespace

TinyLife.Goals

Summary

A job type is a singleton containing various kinds of data for a Job instance. New jobs can be registered using Register.

#ctor(name,hourlyPay,workHours,offWorkDays) constructor

Summary

Creates a new job type with the given settings

Parameters
Name Type Description
name System.String The name of the job
hourlyPay System.Single The hourly wage that this job yields
workHours MonoGame.Extended.Range{System.Int32} A range of hours to work each day
offWorkDays System.DayOfWeek[] The days of the week that are off work

HourlyPay constants

Summary

The amount of dollars that being at the job for an hour pays. In WorkAction, this is automatically added to the household funds.

Name constants

Summary

The name of this job type

OffWorkDays constants

Summary

A set of DayOfWeek values which are days off of this job. On Weekdays contained in this list, the WorkHours don't apply.

Types constants

Summary

A registry of all JobType instances in the game and mods. Register new jobs using Register.

WorkHours constants

Summary

A Range of hours that this job requires each day. Note that the Min value is inclusive, but the Max value is exclusive.

Construct(person) method

Summary

Creates a new Job from this type's information

Returns

A new job instance

Parameters
Name Type Description
person TinyLife.Objects.Person The person that should have the job

GetDisplayName(level) method

Summary

Returns the display name of this JobType, based on the given level. If no level is given, the job's regular name, without the level-based suffix, is returned.

Returns

A localized string representing this job's name

Parameters
Name Type Description
level System.Nullable{System.Int32} The level

IsTimeToWork(time) method

Summary

Returns whether the given time (or the game's current time) is in the bounds of WorkHours and outside of the bounds of OffWorkDays. If this method returns true, WorkAction can be started.

Returns

true if it is time to work, false otherwise

Parameters
Name Type Description
time System.Nullable{System.TimeSpan} The current time. Defaults to CurrentTime.

Register(type) method

Summary

Registers the given job type to the Types registry

Parameters
Name Type Description
type TinyLife.Goals.JobType The type to register

ToScheduleString() method

Summary

Returns a string representation of the schedule. The string includes a line that states the WorkHours and a line that states the OffWorkDays.

Returns

A string representation of this job's schedule

Parameters

This method has no parameters.

LnCategory type

Namespace

TinyLife

Summary

An enumeration that contains a set of localization categories. These categories are represented in a localization file as JSON objects with the given names.

Actions constants

Summary

A localization category for Action-related localizations

BuildMode constants

Summary

A localization category for build mode items and furniture

Clothes constants

Summary

A localization category for clothes and other character creator items

Emotions constants

Summary

A localization category for text related to EmotionType and EmotionModifier

Food constants

Summary

A localization category for food items

Jobs constants

Summary

A localization category for text related to Job

Personalities constants

Summary

A localization category for text related to PersonalityType

Skills constants

Summary

A localization category for text related to Skill

Ui constants

Summary

A localization category for UI elements

Localization type

Namespace

TinyLife

Summary

A class that houses the currently loaded language as well as allows for switching the currently selected language

LanguageNames constants

Summary

A list of the full names of all of the languages that the game supports

Get(category,key) method

Summary

Gets a localized string in the given category with the given key. If the localization is not found, the key, surrounded by question marks, is returned instead.

Returns

The localization of the key

Parameters
Name Type Description
category TinyLife.LnCategory The category that contains the localization
key System.String The key to localize

SetLanguage(language) method

Summary

Switches the current language to the language given. Note that, for most ui elements to update, they have to be re-created.

Parameters
Name Type Description
language System.String The code of the language to set

Lot type

Namespace

TinyLife.World

Summary

A lot is a designated area in the world (created using the LotTool). In the way it works, it acts similarly to a small Map, allowing the retrieval of various object types only in its designated area. A lot has a LotType, which determines what things can be done on the lot.

#ctor(map,area) constructor

Summary

Creates a new lot on the given map with the given area

Parameters
Name Type Description
map TinyLife.World.Map The map
area Microsoft.Xna.Framework.Rectangle The area

Area constants

Summary

The area in the world that this lot occupies

Id constants

Summary

The unique id of this lot. This is randomly generated when the lot is first added to the world, and then persists across savings to disk.

Type constants

Summary

The LotType that this lot has. This value defaults to the "Residential" lot type.

Household property

Summary

The household that is currently occupying this Lot. This can only be non-null if the Type has IsResidential set to true.

AreRequirementsMet() method

Summary

Returns whether this lot Type's RequiredFurniture requirements are currently met

Returns

true if the requirements are met, false otherwise

Parameters

This method has no parameters.

CanImport(import) method

Summary

A method that calculates whether the given ExportedLot can be imported. A lot can be imported if the Household has enough money, and if this lot's Area is greater than or equal to the exported lot's area.

Returns

true if the lot can be imported, false otherwise

Parameters
Name Type Description
import TinyLife.World.ExportedLot The lot to import

CanMove(direction) method

Summary

Returns whether or not the entire lot can be moved in the given direction. The decision is based on this lot's GetCoveredArea and its Area.

Returns

true if the lot can be moved, false otherwise

Parameters
Name Type Description
direction MLEM.Misc.Direction2 The direction to move the lot in

Export() method

Summary

Exports this lot's data, including all of its Furniture, Wall and Roof obejects and its Tile ground. Note that this does not change the lot itself, as it doesn't remove or add anything to it.

Returns

An exported version of this lot

Parameters

This method has no parameters.

GetCoveredArea() method

Summary

Returns a RectangleF that represents the area that this lot actually covers. The area covered by this lot is always bounded by its Area, but will be smaller if there are fewer objects on the lot.

Returns

The area that this lot covers

Parameters

This method has no parameters.

GetFrontDoor() method

Summary

Returns the Wall that this lot's front door is located in. The front door is the door that is closest to this lot's Mailbox that also connects a non-room (the outside) to a room (the inside).

Returns

The wall that the front door is contained in, or null if there is none

Parameters

This method has no parameters.

GetHomeLocation(person) method

Summary

Returns the home location of the given Person on this lot. The home position is the position of the front door on a residential lot (IsResidential) or the closest border position to the passed Person otherwise.

Returns

The person's home location on this lot

Parameters
Name Type Description
person TinyLife.Objects.Person The person whose home location to retrieve

GetObjects``1() method

Summary

Returns the set of all of the MapObject instances on this lot's map that are contained in this lot's Area.

Returns

This lot's objects

Parameters

This method has no parameters.

Generic Types
Name Description
T The type of objects to receive

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetRoofs() method

Summary

Returns a set of all of the Roof instances on this lot's map that are contained in this lot's Area

Returns
Parameters

This method has no parameters.

GetWalls() method

Summary

Returns a set of all of the Wall instances on this lot's map that are contained in this lot's Area

Returns

This lot's walls

Parameters

This method has no parameters.

Import(lot) method

Summary

Imports the given ExportedLot onto this lot. Note that everything that was previously on this lot will be removed (and the money will be returned to this lot's Household). Also note that the Household stays the same, and all tiles outside of the exported lot's area (if it is smaller) are replaced with Grass.

Parameters
Name Type Description
lot TinyLife.World.ExportedLot

Move(direction) method

Summary

Move the entire lot in the given direction (by one tile). Note that CanMove is not called internally.

Parameters
Name Type Description
direction MLEM.Misc.Direction2 The direction to move the lot in

Validate() method

Summary

This method is called when this object is loaded from disk.

Returns

false if the object is not valid, true otherwise

Parameters

This method has no parameters.

LotTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

LotType type

Namespace

TinyLife.World

Summary

A lot type is data for a Lot that determines the required furniture on the lot as well as whether the lot is residential or not. Additionally, custom lot types can define different reasons and interactions for Person objects to visit lots of the type.

#ctor(name,isResidential,requiredFurniture) constructor

Summary

Creates a new lot type with the given settings

Parameters
Name Type Description
name System.String The name of this lot type
isResidential System.Boolean Whether lots of this type should be considered residential
requiredFurniture System.ValueTuple{TinyLife.Objects.FurnitureType,System.Int32}[] A set of furniture (and amounts) that have to be present on lots of this type

IsResidential constants

Summary

Whether this lot is residential. A residential lot is one that Households can move into.

Name constants

Summary

The name of this lot type

RequiredFurniture constants

Summary

A set of furniture that is required on the lot. Each entry determines the FurnitureType required, as well as the amount of that item that is required on the lot.

Types constants

Summary

A registry for all LotType objects that the game and mods define

Register(type) method

Summary

Registers a new lot type to the Types registry

Parameters
Name Type Description
type TinyLife.World.LotType The lot type to register

Map type

Namespace

TinyLife.World

Summary

A map holds all of the data about a city, like its tiles, its objects and its roads. A map is split into MapSection objects which allows faster retrieval of objects in an area.

#ctor(name,sizeInSections) constructor

Summary

Creates a new map with the given name and size

Parameters
Name Type Description
name System.String The name of this map
sizeInSections Microsoft.Xna.Framework.Point The size, in sections, of this map

Name constants

Summary

The name of this map

RoadRadius constants

Summary

This field holds the radius that roads are required to have (in road tiles) excluding the center dotted line tiles. It is set to 2.

Size property

Summary

The size in tiles that this map has. This is always SizeInSections multiplied by Size.

SizeInSections property

Summary

The size, in sections (not tiles) that this map has

StaticVersion property

Summary

The static version of this map. When a new save file is created, a static version of each map is loaded and used as the save file's basis. If the static version of the save file is newer, their save file is updated to the new static map version, which causes all non-lot objects to be copied to the saved map.

AddHousehold(lot,people) method

Summary

Adds a new household to this map by calling the Household constructor.

Returns

The newly created household

Parameters
Name Type Description
lot TinyLife.World.Lot The lot that the household should live on
people TinyLife.Objects.Person[] The people to add to the household

AddLot(area) method

Summary

Adds a new lot with the given area to this map's lots

Returns

The newly created lot

Parameters
Name Type Description
area Microsoft.Xna.Framework.Rectangle The area that the new lot should have

AddObject(obj) method

Summary

Adds the given object to this map. Note that, if the object's Id is already present on this map, this method will cause an exception.

Parameters
Name Type Description
obj TinyLife.Objects.MapObject The object to add to this map

AddRoad(pos) method

Summary

Adds a road to the map at the given position. This doesn't actually add the road tiles, but it notifies the pathfinder that there is a road center at this location.

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to add a road to

AddRoof(roof) method

Summary

Adds the given roof to this map

Parameters
Name Type Description
roof TinyLife.World.Roof The roof to add

AddWall(pos,secondPos) method

Summary

Adds the given wall to the given position.

Returns

Whether the wall could be added

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position that the new wall should have
secondPos Microsoft.Xna.Framework.Point The second position that the new wall should have

AddWall(wall,initializeRooms) method

Summary

Adds the given wall to the given position. Optionally, the Room related to that wall is re-calculated.

Returns

Whether the wall could be added successfully

Parameters
Name Type Description
wall TinyLife.World.Wall The wall to add
initializeRooms System.Boolean Whether rooms should be re-calculated. Defaults to true.

Draw(time,batch,selectionMode) method

Summary

Draws this map and all of its objects. Note that drawing in this manner uses multiple RenderTarget2D objects, for things like the ground and the lightmaps.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
selectionMode System.Boolean Whether we're drawing in selection mode ("ShowSelectionEffect" cheat displays this mode)

GetClosestEmptyTile(pos,radius,ignorePeople,hasToBeOnLot) method

Summary

Returns the position of the closest tile that is empty. An empty tile is a tile that has no MapObject instances on it.

Returns

The closest empty tile, or null if there isn't one

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Vector2 The position to be close to
radius System.Int32 The radius to search for empty tiles in
ignorePeople System.Boolean Whether or not people should be ignored. If this is true, the returned empty tile might currently be occupied by a Person.
hasToBeOnLot System.Boolean Whether or not the returned tile position has to be part of a Lot

GetClosestRoad(pos,radius) method

Summary

Returns the clost road marker to the given position, keeping the given radius in mind.

Returns

The closest road point

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to find the closest road to
radius System.Int32 The radius, in tiles, to search for roads in

GetClosestSidewalk(road,pos) method

Summary

Returns the closest sidewalk position to the given road position. A sidewalk is a tile whose name starts with "Concrete" that is RoadRadius+1 tiles away from the road marker. Note that the road position must have IsRoad return true for it.

Returns

The closest sidewalk position

Parameters
Name Type Description
road Microsoft.Xna.Framework.Point The road marker
pos Microsoft.Xna.Framework.Vector2 The position to which the distance should be shortest

GetDeadPerson(id) method

Summary

Returns a dead Person with the given Guid id

Returns

The dead person instance, or null if there is none

Parameters
Name Type Description
id System.Guid The id to get a dead person by

GetDepth(tilePos,offset,center) method

Summary

Gets the depth that should be used for drawing an object at the given tile position

Returns

The depth to pass to the draw call

Parameters
Name Type Description
tilePos Microsoft.Xna.Framework.Vector2 The position to get depth for, in tile coordinates
offset System.Single An offset added to the depth value
center System.Boolean Whether the position should be centered on the x axis

GetHousehold(person) method

Summary

Returns the household that the given Person lives in

Returns

The person's household, or null if there is none

Parameters
Name Type Description
person TinyLife.Objects.Person The person to query

GetHousehold(lot) method

Summary

Returns the household that lives on the given Lot

Returns

The household that lives on the lot, or null if none lives there

Parameters
Name Type Description
lot TinyLife.World.Lot The lot to query

GetHouseholds() method

Summary

Returns a set of all of the Household instances that live on this map

Returns

This map's households

Parameters

This method has no parameters.

GetLot(id) method

Summary

Returns the lot with the given id on this map. The returned lot's Id will equal the given id.

Returns

The lot with the given id

Parameters
Name Type Description
id System.Guid The id that the lot should have

GetLot(pos) method

Summary

Returns the lot that is present at the given position. The lot returned will always have its Area contain the passed position.

Returns

The lot at that position, or null if there is none

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to query

GetLots() method

Summary

Returns a set of all of the Lot objects on this map

Returns

This map's lots

Parameters

This method has no parameters.

GetObject``1(id) method

Summary

Returns the object with the given id of the given type. If there is no object with that id, or its type does not match, null is returned.

Returns

The object, or null if there is no matching one

Parameters
Name Type Description
id System.Guid The id that the returned object should have
Generic Types
Name Description
T The type that the object is expected to have

GetObjects``1(area) method

Summary

Returns a set of objects that are present in the given area.

Returns

A set of objects that match the criteria

Parameters
Name Type Description
area MLEM.Misc.RectangleF The area, in tile coordinates
Generic Types
Name Description
T The type that the objects need to have

GetPathCost(currPos,nextPos) method

Summary

Returns the cost to pathfind from the given current position to the given next position. Note that, for this method to return a proper result, nextPos has to be directly or diagonally adjacent to currPos.

Returns

The cost to path to this location

Parameters
Name Type Description
currPos Microsoft.Xna.Framework.Point The current position
nextPos Microsoft.Xna.Framework.Point The next, neighboring position

GetPeople() method

Summary

Returns all of the Person objects that are on this map

Returns

This map's people

Parameters

This method has no parameters.

GetRoads() method

Summary

Returns a set of all of the road markers on this map

Returns

A set of all road markers on this map

Parameters

This method has no parameters.

GetRoof(pos) method

Summary

Gets a Roof whose area contains the given position

Returns

The roof at that position, or null if there is none

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to find a roof at

GetRoom(pos) method

Summary

Returns the room that the given position is contained in

Returns

The room at that location, or null if there is none

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to query

GetSection(pos) method

Summary

Returns the MapSection at the given tile position

Returns

The section at that position

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The tile position

GetSections(point,radiusIncrease) method

Summary

Returns a set of sections that are contained in (or intersect with) the given area

Returns

A set of sections covered by this area

Parameters
Name Type Description
point Microsoft.Xna.Framework.Point The position to find the section for, in tile coordinates
radiusIncrease System.Int32 The radius, in sections, that the search area should be extended by

GetSections(area,radiusIncrease) method

Summary

Returns a set of sections that are contained in (or intersect with) the given area

Returns

A set of sections covered by this area

Parameters
Name Type Description
area MLEM.Misc.RectangleF The area to find sections in, in tile coordinates
radiusIncrease System.Int32 The radius, in sections, that the search area should be extended by

GetTile(pos) method

Summary

Returns the tile at the given position on this map

Returns

The tile at that position

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to query

GetWallBetween(pos,secondPos) method

Summary

Returns the wall between the pos and secondPos. A wall is between two positions if its Positions are exactly those two positions, ignoring their order.

Returns

The wall between the two positions, or null if there is none

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The first position
secondPos Microsoft.Xna.Framework.Point The second position

IsFreeSpot(pos) method

Summary

Returns whether or not the given position on the given map is free for a Person to stand in

Returns

Whether this position is free to stand on

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to query

IsInBounds(pos) method

Summary

Returns whether the given position is in bounds of this map's Size

Returns

true if the position is in bounds, false otherwise

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to query

IsInSectionBounds(section) method

Summary

Returns whether the given section position is in bounds of this map's SizeInSections.

Returns

true if the position is in bounds, false otherwise

Parameters
Name Type Description
section Microsoft.Xna.Framework.Point The section position to query

IsRoad(pos) method

Summary

Returns whether the given position contains a road. This doesn't query road tiles, but it queries for road markers added by AddRoad.

Returns
Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point

LoadStaticMap(name) method

Summary

Loads a static map with the given name from the game's content directory. Note that this also validates the map (Validate).

Returns

The static map that was loaded

Parameters
Name Type Description
name System.String The name of the static map

MarkDirtyForPathfinding(pos) method

Summary

Marks the given position dirty for pathfinding purposes. When a path is found again close to this position, its cost (GetPathCost) will be re-calculated. This method is called by Furniture when it is placed for removed.

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to mark dirty

PlaySound(sound,pos,volume,pitch,loop) method

Summary

Plays a sound at the given location (in world space) statically. If the sound should move while being played, use PlaySound instead. Note that the returned SoundEffectInstance does not need to be disposed when it is finished playing.

Returns

The sound effect instance that is responsible for playing this sound, which can be stopped or paused

Parameters
Name Type Description
sound Microsoft.Xna.Framework.Audio.SoundEffect The sound effect to play
pos Microsoft.Xna.Framework.Vector2 The position, in world space, to play the sound at
volume System.Single The sound's volume, between 0 and 1 (default)
pitch System.Single The sound's pitch, between -1, 0 (default) and 1
loop System.Boolean Whether or not the sound should loop

PlaySound(sound,emitter,volume,pitch,loop) method

Summary

Plays a sound at the given location (in world space) with the given AudioEmitter, whose Position can be updated by the caller (in screen space). If the sound should move in a static locatdion, use PlaySound instead. Note that the returned SoundEffectInstance does not need to be disposed when it is finished playing.

Returns

The sound effect instance that is responsible for playing this sound, which can be stopped or paused

Parameters
Name Type Description
sound Microsoft.Xna.Framework.Audio.SoundEffect The sound effect to play
emitter Microsoft.Xna.Framework.Audio.AudioEmitter The audio emitter, whose Position should be set in screen space
volume System.Single The sound's volume, between 0 and 1 (default)
pitch System.Single The sound's pitch, between -1, 0 (default) and 1
loop System.Boolean Whether or not the sound should loop

RemoveHousehold(household) method

Summary

Removes the given household from this map

Parameters
Name Type Description
household TinyLife.World.Household The household to remove

RemoveLot(lot) method

Summary

Removes the given lot from this map's lots

Parameters
Name Type Description
lot TinyLife.World.Lot The lot to remove

RemoveObject(obj) method

Summary

Removes the given object from this map and its underlying MapSection. This also calls OnRemoved.

Parameters
Name Type Description
obj TinyLife.Objects.MapObject The object to remove

RemoveRoof(roof) method

Summary

Removes the given Roof from this map

Parameters
Name Type Description
roof TinyLife.World.Roof The roof to remove

RemoveWall(wall) method

Summary

Removes the given wall from the map

Returns

Whether the wall was present on the map and could be removed

Parameters
Name Type Description
wall TinyLife.World.Wall The wall to remove

SetTile(pos,tile) method

Summary

Sets the tile at the given position to the given tile

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position
tile TinyLife.World.Tile The tile

Update(time,passedInGame,speed) method

Summary

Updates this map, its MapSection objects and its Households.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
passedInGame System.TimeSpan The amount of time that has passed in game
speed TinyLife.GameSpeed The speed that the game is set to

Validate() method

Summary

This method is called when this object is loaded from disk. When called on a map, each MapSection is validated, and roads and rooms are generated.

Parameters

This method has no parameters.

MapObject type

Namespace

TinyLife.Objects

Summary

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.

#ctor(id,map,position) constructor

Summary

Creates a new map object with the given settings

Parameters
Name Type Description
id System.Guid The object's id
map TinyLife.World.Map The map the object should be on
position Microsoft.Xna.Framework.Vector2 The position that the object should have

Categories constants

Summary

A list of all of the ObjectCategory flags that exist

Id constants

Summary

The Guid of this object instance

CurrentLot property

Summary

A property that returns the CurrentLot that this object is currently on

Map property

Summary

The map that this object is currently on. If this is null, the object is not currently on a map.

Position property

Summary

The position on the Map of this object. If this is set to -1, -1, that is usually an indicator that the object is currently not in the world.

Draw(time,batch,drawPos,overrideColor) method

Summary

Draws this object on the current Map, at the current Position.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
drawPos Microsoft.Xna.Framework.Vector2 The position, in draw space, to draw this furniture at
overrideColor System.Nullable{Microsoft.Xna.Framework.Color} The color that should be used instead of this object's actual color. If null, the object's regular color should be used.

GetAiPriority(person) method

Summary

Returns an integer that represents a priority for the PersonAi's interaction with this object. A higher priority means that this object will be picked over other objects (with lower priority). The default return value is 0, meaning that no special priority is assigned to this object. For any Furniture with the Bed category that is the person's LastBedSleptIn, 10 is returned.

Returns

This object's priority

Parameters
Name Type Description
person TinyLife.Objects.Person The person whose AI is attempting to interact with this object

GetCategories(person) method

Summary

Returns a set of ObjectCategory flags that this object has, based on the given Person.

Returns

A set of categories that this object has

Parameters
Name Type Description
person TinyLife.Objects.Person The person to query categories for

GetHoverInfo() method

Summary

Returns a Tooltip object that is displayed whenever the mouse is hovered over this object in the world. By default, this method returns null, which will cause no tooltip to be displayed.

Returns

The tooltip to display

Parameters

This method has no parameters.

GetModCategory(name) method

Summary

Adds and returns a custom ObjectCategory with the given name. Note that the returned category is not IsDefined, and thus, does not have a name. The returned category is guaranteed to be unique and mapped to the given name. Additionally, it can be used in combined flags, as it is not a combined flag itself.

Returns

A new object category

Parameters
Name Type Description
name System.String The name that the category should have

Intersects(rectangle) method

Summary

Returns whether this map object intersects with the given rectangle. This is used for GetObjects``1

Returns

true if this object intersects with the given rectangle

Parameters
Name Type Description
rectangle MLEM.Misc.RectangleF The area that should be checked for

OnAdded() method

Summary

This method is called when this object is added to a Map. By default, it does nothing.

Parameters

This method has no parameters.

OnRemoved() method

Summary

This method is called when this object is removed from a Map. By default, it does nothing.

Parameters

This method has no parameters.

SetMapAndValidate(map) method

Summary

This method is the same as Validate, but it also sets the Map.

Returns

false if the object is not valid, true otherwise

Parameters
Name Type Description
map TinyLife.World.Map The map to set

Validate() method

Summary

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 does nothing.

Returns

false if the object is not valid, true otherwise

Parameters

This method has no parameters.

MapSection type

Namespace

TinyLife.World

Summary

A map section is a small area in a Map that actually contains the area's objects. A map section is always SizexSize tiles large.

#ctor(map,sectionPos) constructor

Summary

Creates a new map section on the given map, with the given section position. Also fills this map's tile array with the Grass tile.

Parameters
Name Type Description
map TinyLife.World.Map The map
sectionPos Microsoft.Xna.Framework.Point The section coordinates

SectionPos constants

Summary

The position, in section coordinates, of this section on the map.

Size constants

Summary

The constant size of each map section. This value is set to 8.

Pos property

Summary

The position, in tile coordinates, of this section's top left corner.

RemoveOutdatedRooms() method

Summary

Removes all outdated rooms on this map. This is called by AddWall and a few other methods.

Returns

Whether any outdated rooms were removed

Parameters

This method has no parameters.

Update(time,passedInGame,speed) method

Summary

Updates this map section and all of the objects on it

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
passedInGame System.TimeSpan The amount of time that has passed in game
speed TinyLife.GameSpeed The game's speed

Validate() method

Summary

This method is called when this object is loaded from disk. When called on a map section, each of its MapObject instances is validated.

Parameters

This method has no parameters.

Mod type

Namespace

TinyLife.Mods

Summary

The base class for all Tiny Life mods. For an example mod, see . Mods are uniquely identified by their ID. The id is the name of the class that extends Mod.

Description property

Summary

The description of this mod, which will be visible in the options menu. To localize the description, use Localization.

Icon property

Summary

The icon texture region of this mod, which will be visible in the options menu

Name property

Summary

The display name of this mod, which will be visible in the options menu

AddGameContent(game) method

Summary

Add the content that this mod provides for the given GameImpl instance. The following ways of content registration are supported: Register to register furniture types, Register to register action types, Register to register clothes (and hair), Register to register skills, Register to register wallpapers, Register to register tiles.

Parameters
Name Type Description
game TinyLife.GameImpl

GetCustomFurnitureTextures() method

Summary

Return a list of paths (relative to this mod's Content directory) to textures that contain the texture regions used by this mod's custom FurnitureTypes. Note that the furniture texture needs to have an associated DataTextureAtlas file in the same location, but with the .atlas file extension. By default, an empty IEnumerable`1 is returned.

Returns

The custom data texture atlases for this mod's furniture

Parameters

This method has no parameters.

Initialize(logger,content,texturePacker) method

Summary

Initialize the data for this mod, including textures, sounds and other data. The RawContentManager is a variation of MonoGame's ContentManager and should be used to load mod content.

Parameters
Name Type Description
logger ExtremelySimpleLogger.Logger The logger that can be used to write info about this mod to the console
content MLEM.Data.Content.RawContentManager The content manager for this mod
texturePacker MLEM.Data.RuntimeTexturePacker The texture packer that packs added textures into one big texture

ModInfo type

Namespace

TinyLife.Mods

Summary

A mod info is a set of properties that every Mod instance is assigned

Content constants

Summary

A RawContentManager that this mod can use to load its content. This content manager's base directory automatically points to the mod's Content folder.

Id constants

Summary

The id of the mod, which is based on the Mod's class name

Logger constants

Summary

The Logger that this mod can use to log information about itself. By default, this logger has the same sinks as the game's logger.

Mod constants

Summary

The actual mod instance

Dispose() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ModLoader type

Namespace

TinyLife.Mods

Summary

The mod loader loads Mod instances from the GetModsFolder.

GetModsFolder() method

Summary

Returns a DirectoryInfo pointing to the directory that mods should be put into and loaded from

Returns

The mod directory

Parameters

This method has no parameters.

TryGetModInfo(id,info) method

Summary

This method can be used to gather a ModInfo for a mod that is currently loaded with the given id. If no mod with that id is currently loaded, this method returns false and assigns null to ModInfo.

Returns

Whether or not the mod was found to be loaded

Parameters
Name Type Description
id System.String The id of the mod to get
info TinyLife.Mods.ModInfo@ The info that will be returned about the mod

MoveLotTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

InitBuildModeUi() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

MoveTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

CanSaveOrSwitchModes() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ForceWallsUp() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetMouseCursor() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

InitBuildModeUi() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

MultiAction type

Namespace

TinyLife.Actions

Summary

A multi action is an action that can have different actions executed before and/or after itself. This is quite useful if an action requires a Person to go somewhere to pick up an item etc.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

FirstActions property

Summary

The actions that should be executed beore this action

MainElapsedTime property

Summary

The amount of time that has elapsed of this action, excluding the time that FirstActions took.

NextActions property

Summary

The actions that should be executed after this action

AndThenInitialize() method

Summary

Initializes the main action. This method is called after FirstActions have all completed.

Parameters

This method has no parameters.

AndThenIsCompleted() method

Summary

MultiAction version of IsCompleted. This method returns whether or not the main action is completed.

Returns

Whether the main action is completed

Parameters

This method has no parameters.

AndThenOnCompleted(type) method

Summary

MultiAction version of OnCompleted. This method gets called when the main action completes. This is also called before CreateNextActions is called.

Parameters
Name Type Description
type TinyLife.Actions.Action.CompletionType The completion of the main action

AndThenUpdate(time,passedInGame,speed) method

Summary

MultiAction version of Update. This method is called every update frame while the main action is active. By default, only MainElapsedTime is increased.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current game time
passedInGame System.TimeSpan The amount of time that has passed, in game time
speed TinyLife.GameSpeed The game's speed

CanCancel() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CreateFirstActions() method

Summary

Return a set of actions that should be executed before this action. Even if the yield statement is used, all actions will be collected into a list at the start of this action's invocation. If no action gets returned in this function, this action fails.

Returns

A set of actions that sohuld run before this action

Parameters

This method has no parameters.

CreateNextActions(type) method

Summary

Return a set of actions that should be executed after this action. Can be empty.

Returns

A set of actions after this action

Parameters
Name Type Description
type TinyLife.Actions.Action.CompletionType The completion of the main action

Initialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

IsCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnBetweenActions(time,passedInGame,speed,completedAction,completion) method

Summary

A method that is called after ShouldFail returns false and before the next action is started. If this method returns true, the next action is not started yet, meaning that this action can fulfil tasks inbetween sub-actions.

Returns

false to start the next sub-action (or the main action), true to wait

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current game time
passedInGame System.TimeSpan The amount of time that has passed, in game time
speed TinyLife.GameSpeed The game's current speed setting
completedAction TinyLife.Actions.Action The action that has completed
completion TinyLife.Actions.Action.CompletionType The completion type of the action that has completed

OnCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldFail(completedAction,completion) method

Summary

A method that returns whether or not this main action should fail if the previous or next completedAction completed with the given completion. By default, this method returns true only if completion is not Completed.

Returns

true if we should fail due to this completion

Parameters
Name Type Description
completedAction TinyLife.Actions.Action The action that has completed
completion TinyLife.Actions.Action.CompletionType The completion type of the action

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Need type

Namespace

TinyLife

Summary

A need is a desire that a Person can have to a given extent, defined by Value. Each need is instantiated through its associated NeedType.

#ctor(type) constructor

Summary

Instantiate a new need from the given NeedType

Parameters
Name Type Description
type TinyLife.NeedType The type to instantiate the need from

Max constants

Summary

The maximum value that the Value can have

Type constants

Summary

The NeedType that this need instance originates from

Percentage property

Summary

The Value divided by Max, yielding a floating point number between 0 and 1, representing the percentage fullness of this need

Value property

Summary

The current value of this need. Automatically gets clamped to a number between 0 and Max.

NeedType type

Namespace

TinyLife

Summary

A need is a desire that a Person can have to a given extent. To register a custom need type, use Register.

#ctor(name,passiveReduction,needLowAction,needLowTime,solveImportance) constructor

Summary

Instantiates a new need type with the given settings

Parameters
Name Type Description
name System.String The name of this need
passiveReduction System.Single The amount that this need instance's Value is reduced by automatically every update frame
needLowAction System.Func{TinyLife.Objects.Person,TinyLife.Actions.ActionType} The action that is executed when this need's value is very low
needLowTime System.Func{TinyLife.Objects.Person,System.TimeSpan} The amount of in-game time until needLowAction is enqueued
solveImportance System.Single The priority for solving this need over other needs, where higher numbers are more urgent

Name constants

Summary

The name of this need. Used for Localization purposes and saving to disk.

NeedLowAction constants

Summary

The ActionType that is constructed and executed when this need type's Value is very low

NeedLowTime constants

Summary

The amount of in-game time that needs to pass until NeedLowAction is constructed and enqueued

PassiveReduction constants

Summary

The amount that a need instance's Value is reduced by automatically every update frame

SolveImportance constants

Summary

The priority for solving this need over other needs, where higher numbers represent a more urgent need. This value defaults to 0, meaning it has no special importance.

Types constants

Summary

A list of all of the need types that are currently registered. Register custom need types using Register.

Register(type) method

Summary

Register the NeedType specified to the Types dictionary

Returns

The need typep passed, for chaining

Parameters
Name Type Description
type TinyLife.NeedType The need type to register

Notifications type

Namespace

TinyLife.Uis

Summary

This class holds information about the current and past notifications that are displayed in the top center of the screen. To create custom notifications, use Add or Add.

Add(obj,content) method

Summary

Adds a new notification related to the given map object. The passed object is also the one that will be displayed in the notification.

Parameters
Name Type Description
obj TinyLife.Objects.MapObject The map object that this notification relates to
content System.String The content of the notification. Should be localized using Localization

Add(icon,content) method

Summary

Adds a new notification related to nothing. The passed icon is displayed instead of an object.

Parameters
Name Type Description
icon MLEM.Textures.TextureRegion The icon that should be displayed in the notification
content System.String The content of the notification. Should be localized using Localization

ObjectCategory type

Namespace

TinyLife.Objects

Summary

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 this is a FlagsAttribute enumeration. Custom modded categories can be added and retrieved using GetModCategory.

Bed constants

Summary

An object category that represents objects where one can sleep

Bookshelf constants

Summary

An object category that represents things that books are stored in

Chair constants

Summary

An object category that represents sittable surfaces

Cleanable constants

Summary

An object category that represents objects that can be cleaned in a Sink

Computer constants

Summary

An object category that represents computers

Counter constants

Summary

An object category that represents objects where one can prepare food and place CounterObject objects

CounterObject constants

Summary

An object category that represents objects that can be placed on Counter objects

DeskObject constants

Summary

An object category that represents objects that can be placed on desk-like tables

DisallowedOnGround constants

Summary

An object category that represents objects that cannot be placed on the ground, but only in object spots

Easel constants

Summary

An object category that represents places where one can paint paintings

ForceGridPlacement constants

Summary

An object category that represents objects which cannot be placed off the grid using the ALT key in the FurnitureTool

Fridge constants

Summary

An object category that represents objects where one can get food ingredients

GentleCulling constants

Summary

An object category that represents objects that should be culled more gently (in a bigger radius). This property should be assigned to objects that are fairly large in display size.

Gravestone constants

Summary

An object category that represents gravestones

Ground constants

Summary

An object category that represents the ground

Holdable constants

Summary

An object category that represents objects that can be held by a Person

Mailbox constants

Summary

An object category that represents mailboxes

Mirror constants

Summary

An object category that represents mirrors

NaturalGroundRequired constants

Summary

An object category that represents objects that can only be placed on natural ground, namely grass tiles

NonBuyable constants

Summary

An object category that represents objects that cannot be bought in the FurnitureTool

NonColliding constants

Summary

An object category that represents things that a Person does not collide with

NonMovable constants

Summary

An object category that represents things that cannot be moved using MoveTool

NonSellable constants

Summary

An object category that represents things that cannot be solved or removed using RemoveTool

Nothing constants

Summary

An object category that reprsents an object without any properties

People constants

Summary

An object category that all Person instances hae

Self constants

Summary

An object category that represents the object that contains it

Shower constants

Summary

An object category that represents objects where one can shower

Sink constants

Summary

An object category that represents objects where one can clean dishes and wash hands

SmallObject constants

Summary

An object category that represents objects that can sit on Counter and Table objects

Stove constants

Summary

An object category that represents objects where one can cook food

Table constants

Summary

An object category that represents objects where one can place SmallObject objects

Toilet constants

Summary

An object category that represents objects where one can use the toilet

Tree constants

Summary

An object category that represents trees

WallHanging constants

Summary

An object category that represents objects which need to be hung on Wall objects

Wardrobe constants

Summary

An object category that represents objects where a Person can change

ObjectSpot type

Namespace

TinyLife.Objects

Summary

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.

#ctor(offset,isFurnitureAllowed,yOffset,validDirections) constructor

Summary

Creates a new object spot with the given settings

Parameters
Name Type Description
offset Microsoft.Xna.Framework.Vector2 The offset on both the x and y axis that this spot has
isFurnitureAllowed System.Predicate{TinyLife.Objects.FurnitureType} A predicate that determines if the given FurnitureType is allowed to be put into this spot
yOffset System.Single The offset on the visual y axis
validDirections MLEM.Misc.Direction2[] The directions that this spot can be accessed from

#ctor(offset,visualOffset,isFurnitureAllowed,yOffset,validDirections) constructor

Summary

Creates a new object spot with the given settings

Parameters
Name Type Description
offset Microsoft.Xna.Framework.Vector2 The offset on both the x and y axis that this spot has
visualOffset Microsoft.Xna.Framework.Vector2 The visual offset on both the x and y axis that this spot has
isFurnitureAllowed System.Predicate{TinyLife.Objects.FurnitureType} A predicate that determines if the given FurnitureType is allowed to be put into this spot
yOffset System.Single The offset on the visual y axis
validDirections MLEM.Misc.Direction2[] The directions that this spot can be accessed from

IsFurnitureAllowed constants

Summary

A predicate that determines if the given FurnitureType is allowed to be put into this object spot

CounterSpots(stove) method

Summary

A helper method to create a set of ObjectSpot instnaces for counters and stoves. The resulting set contains a single object spot for SmallObject and CounterObject object, or PreparedFood and Pot if stove is true.

Returns

A set of object spots for the stove or counter

Parameters
Name Type Description
stove System.Boolean Whether the object is a stove (or a counter)

GetContents``1(furniture) method

Summary

Returns the Furniture objects that are currently slotted into this spot

Returns

A set of children of this spot, or an empty set if there are none

Parameters
Name Type Description
furniture TinyLife.Objects.Furniture The furniture that this spot belongs to
Generic Types
Name Description
T The type the child furnitures are expected to be

TableSpots(size) method

Summary

A helper method to create a set of ObjectSpot instances for a table of the given size. The resulting set of object spots will have spots for Chair objects on each side as well as SmallObject objects on each tile position.

Returns

A set of object spots for the table

Parameters
Name Type Description
size Microsoft.Xna.Framework.Point The size that the table has in tiles

Opening type

Namespace

TinyLife.World

Summary

An opening is some sort of extrusion in a Wall, like a window or a door. Openings are created from their underlying OpeningType.

#ctor(type,color) constructor

Summary

Creates a new opening from the given opening type and color

Parameters
Name Type Description
type TinyLife.World.OpeningType The opening type
color System.Int32 The index of the color

Color constants

Summary

The index of the OpeningType's ColorScheme that this opening instance has

Type constants

Summary

The OpeningType that this opening has

CanWalkThrough() method

Summary

Returns whether a Person is able to walk through a Wall that has this opening. This returns true for Door and false for Opening.

Returns
Parameters

This method has no parameters.

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OpeningTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetMouseCursor() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

InitBuildModeUi() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OpeningType type

Namespace

TinyLife.World

Summary

An opening is some sort of extrusion in a Wall, like a window or a door. An opening type stores data that can be used to construct a Opening instance.

#ctor(name,textureRegion,wallMode,price,construct,colorScheme,icon) constructor

Summary

Creates a new opening type with the given settings

Parameters
Name Type Description
name System.String The name
textureRegion MLEM.Textures.TextureRegion The texture to use for rendering
wallMode TinyLife.World.WallMode The wall mode
price System.Int32 The price
construct System.Func{TinyLife.World.OpeningType,System.Int32,TinyLife.World.Wall,TinyLife.World.Opening} The function that is used for constructing an Opening from this opening type
colorScheme TinyLife.Utilities.ColorScheme The color scheme for this opening
icon MLEM.Textures.TextureRegion The build mode category icon of this object

ColorScheme constants

Summary

The color scheme that opening instances can have when created from this type

Icon constants

Summary

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.

Name constants

Summary

The name of this opening type

Price constants

Summary

The price of this opening

Types constants

Summary

A registry for all OpeningType instances from the game and mods. Use Register to register custom opening types.

WallMode constants

Summary

The WallMode that Wall instances with this opening in it should use for rendering

Construct(color,wall) method

Summary

Constructs a new Opening instance from this opening type

Returns

A new opening instance based on this type

Parameters
Name Type Description
color System.Int32 The color index to use
wall TinyLife.World.Wall The wall that this opening will be slotted into

Draw(time,batch,drawPos,vertical,scale,depth,color) method

Summary

Draws this opening in a wall

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to render with
drawPos Microsoft.Xna.Framework.Vector2 The position, in screen space, to draw at
vertical System.Boolean Whether the underlying wall is vertical
scale System.Single The scale to render with
depth System.Single The depth to use for rendering
color System.Int32 The color index that should be used for rendering

DrawUi(e,batch,time,color,drawScale) method

Summary

Draws this opening in ui space rather than world space

Parameters
Name Type Description
e MLEM.Ui.Elements.Element The ui element to draw this opening onto
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
time Microsoft.Xna.Framework.GameTime The game time
color System.Int32 The color index to draw with
drawScale System.Single The scale to draw with. 0.3 by default.

Register(type) method

Summary

Registers the given OpeningType to the Types registry

Parameters
Name Type Description
type TinyLife.World.OpeningType The type to register

Options type

Namespace

TinyLife

Summary

The game's options, which are displayed in the InitializeOptions menu and saved to disk

Fullscreen constants

Summary

Whether the game is currently in fullscreen mode

GameSpeeds constants

Summary

An array of all defined GameSpeed values

Language constants

Summary

The currently selected language's language code. Determines the language used by Localization.

SoundVolume constants

Summary

The current sound volume as a percentage, ranging from 0 to 1

UiScale constants

Summary

A modifier that is applied to the game's UiSystem's GlobalScale

VSync constants

Summary

Whether vertical synchronization is currently turned on

WallDisplays constants

Summary

An array of all defined WallDisplay values

Instance property

Summary

The static singleton instance of Options

WallMode property

Summary

The currently selected WallMode. Note that this value does not always return the wall mode that has been selected by the user: If Mode is SelectHousehold, Roofs is returned. If the CurrentTool overrides ForceWallsUp, that value is returned.

Apply() method

Summary

Applies the currently selected options of this instance to the game

Parameters

This method has no parameters.

Load() method

Summary

Loads the options from the default options file path and stores them in Instance. If there are no options in the default options file, a new instance is created.

Parameters

This method has no parameters.

Save() method

Summary

Saves the options to the default options file path

Parameters

This method has no parameters.

OutOfTownAction type

Namespace

TinyLife.Actions

Summary

An out-of-town action is an action where the Person finds the closest exit road and then exits the city using that road. Out-of-town actions are things like going to work, where the destination location isn't visible to the player.

#ctor(type,info,needsToTakeCareOf) constructor

Summary

Creates a new out-of-town action with the given settings. Note that, since some data is not saved to disk, all of the information should be provided by a subclass constructor.

Parameters
Name Type Description
type TinyLife.Actions.ActionType The action type
info TinyLife.Actions.ActionInfo The action info
needsToTakeCareOf TinyLife.NeedType[] The needs that should automatically be taken care of

NeedsToTakeCareOf constants

Summary

The needs that should automatically be taken care of while the person is out of town. A need gets taken care of in AndThenUpdate if it is below 35%. Note that this value is not saved to disk, and should be provided by a subclass constructor.

AndThenInitialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

AndThenUpdate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CanEnqueueConversation() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CausesExtremelyFastSpeed() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CreateFirstActions() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetClosestExitRoad() method

Summary

Returns the point of the road that is at the edge of the map and the Direction2 that the map border is in, and is also closest to the Person. Since every map is expected to have at least one exit road, no checking is done to ensure that one exists.

Returns

The closest exit road

Parameters

This method has no parameters.

GetNextAction() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Painting type

Namespace

TinyLife.Objects

Summary

Inherit from parent.

Painting type

Namespace

TinyLife.Skills

Summary

The Painting class holds various options and settings related to the Painting skill

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Creator constants

Summary

The Guid of the Person that created, and is painting this painting. This value defaults to Empty, meaning no creator.

PaintingType constants

Summary

The type of painting that this object displays

Progress constants

Summary

The progress that has been done on this painting by the Creator so far. This value defaults to 1, which is 100%.

Quality constants

Summary

The Quality that this painting has. This value default to Average, but may be different if there is a Creator.

PaintingTypes constants

Summary

All registered PaintingType instances in the game and in active mods

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetHoverInfo() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

RegisterPaintingType(type) method

Summary

Registers a painting type with the given settings to the PaintingTypes registry

Parameters
Name Type Description
type TinyLife.Skills.Painting.PaintingType The type to register

PaintingType type

Namespace

TinyLife.Skills.Painting

Summary

This class represents a type of Painting that can be created using the Painting. Painting types are registered using RegisterPaintingType.

#ctor(name,levelRange,baseMarkup) constructor

Summary

Creates a new painting type with the given settings

Parameters
Name Type Description
name System.String The name of this painting type
levelRange MonoGame.Extended.Range{System.Int32} The range of levels of the painting skill that should allow for creation of this painting
baseMarkup System.Single The multiplier with which the created painting's price will be marked up

BaseMarkup constants

Summary

The multiplier with which the created Painting's price will be marked up. Before this multiplier is applied, the level and quality modifiers are also applied.

LevelRange constants

Summary

The Range`1 of levels of the Painting skill that allows creating this painting

Name constants

Summary

The name of this painting type

Texture constants

Summary

The texture that this painting uses. Note that this texture is just an overlay; the frame and white background are automatically drawn.

Particle type

Namespace

TinyLife.Objects

Summary

A particle is a 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.

#ctor(region,timeToLive,position) constructor

Summary

Creates a new particle with the given settings

Parameters
Name Type Description
region MLEM.Textures.TextureRegion The texture that this particle should display with
timeToLive System.TimeSpan The amount of real time that this particle should stay alive for
position Microsoft.Xna.Framework.Vector2 The position that this particle should have, in world space

#ctor(animation,timeToLive,position) constructor

Summary

Creates a new particle with the given settings

Parameters
Name Type Description
animation MLEM.Animations.SpriteAnimation The animation that this particle should display with
timeToLive System.TimeSpan The amount of real time that this particle should stay alive for
position Microsoft.Xna.Framework.Vector2 The position that this particle should have, in world space

Animation constants

Summary

The SpriteAnimation that this particle displays over its lifespan

DepthOffset constants

Summary

The amount of tiles that this particle's depth display calculation is offset by, from its Position

DrawOffset constants

Summary

The amount of tiles that this particle's display position is offset by, from its Position

Friction constants

Summary

The friction that is applied to this particle's Motion every Update frame

Motion constants

Summary

The amount that this particle's Position is modified by each Update frame

Position constants

Summary

The position in the world of this particle

Scale constants

Summary

An Easing that determines how this particle's scale (display size) changes based on its TimeToLive and TimeLived

TimeLived constants

Summary

The amount of real time that this particle has lived for. This time span will always be lower than or equal to TimeToLive.

TimeToLive constants

Summary

The amount of real time that this particle should stay alive for until it disappears

Map property

Summary

The map that this particle is on. Note that this always returns Map

Draw(time,batch,drawPos) method

Summary

Draws this particle on the current Map, at the current Position.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
drawPos Microsoft.Xna.Framework.Vector2 The position, in draw space, to draw this furniture at

Spawn(particle) method

Summary

Adds a new particle to the map

Parameters
Name Type Description
particle TinyLife.Objects.Particle The particle to spawn

Update(time,passedInGame,speed) method

Summary

The update method, which is called every update frame by the underlying Map

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
passedInGame System.TimeSpan The amount of time that has passed since the last call
speed TinyLife.GameSpeed The game's speed

PathfindAction type

Namespace

TinyLife.Actions

Summary

A pathfinding action is an action that first finds a path and then allows that path to be traversed. The pathfinding is done using AStar2.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Path property

Summary

The path that this action has found. WHen OnPathReady is called, this has a value.

PathReady property

Summary

A property that determines whether or not the Path has been calculated.

FindPath(goal) method

Summary

A method called by Initialize to start finding a path to the given goal location.

Returns

A task that, when finished, returns a path

Parameters
Name Type Description
goal Microsoft.Xna.Framework.Point The goal location

GetSpeed() method

Summary

Returns the speed that the Person should traverse with.

Returns

The speed

Parameters

This method has no parameters.

Initialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

IsCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnPathReady() method

Summary

This method is called when the PathReady variable is set to true. At the point of this method being claled, Path will have a value.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

PerSaveOptions type

Namespace

TinyLife

Summary

The game's per-save options, which are displayed in the InitializeOptions menu and saved to disk. Note that Instance is null if there is no Map loaded.

DisableAiHousehold constants

Summary

Whether the AI of everyone in the CurrentHousehold should be disabled or not

DisableAiSelected constants

Summary

Whether the AI of the SelectedPerson should be disabled or not

Instance property

Summary

The static singleton instance of PerSaveOptions. Note that this value is null if there is no Map loaded.

Load() method

Summary

Loads the options from the default options file path and stores them in Instance. If there are no options in the default options file, a new instance is created.

Parameters

This method has no parameters.

Save() method

Summary

Applies the currently selected options of this instance to the game

Parameters

This method has no parameters.

Person type

Namespace

TinyLife.Objects

Summary

A person is a MapObject placed on a Map that represents a person. It stores its actions, clothes, data and movement.

#ctor(map,position) constructor

Summary

Creates a new person with the given settings

Parameters
Name Type Description
map TinyLife.World.Map The map to place this person on
position Microsoft.Xna.Framework.Vector2 The position to place this person on

ActionQueue constants

Summary

The actions that are currently enqueued to be executed by this person. Each entry is the action that is enqueued along with a boolean value that represents whether this action was started automatically (true) or manually (false). Use EnqueueAction and CancelAction to modify this list.

Colors constants

Summary

Obsolete, use WornClothes instead

CurrentActions constants

Summary

The actions that are currently being executed by this person. Use EnqueueAction and CancelAction to modify this list.

CurrentPose constants

Summary

This person's current Pose. Note that this value is not saved to disk, and is reset to Standing every Update frame.

EmotionModifiers constants

Summary

The Instance objects that are currently applied to this person. To access this collection efficiently, use AddEmotion, RemoveEmotion and LowerEmotion.

FirstName constants

Summary

This person's first name

LastBedSleptIn constants

Summary

The id of the last bed Furniture that this person has slept in, or Empty if no such bed exists

LastName constants

Summary

This person's last name

Layers constants

Summary

Obsolete, use WornClothes instead

Needs constants

Summary

This person's Need data. When this person is instantiated, all of their needs are gathered from Types automatically. To access this collection efficiently, use GetNeed and GetNeedPercentage.

PersonalityTypes constants

Summary

The names of the PersonalityType values that this person has. To access this collection efficiently, use HasPersonality.

Portrait constants

Summary

The RenderTarget2D that this person's portrait is rendered onto. This will automatically be updated and can be used for rendering of any kind.

Relationships constants

Summary

This person's Relationship data. To access this collection efficiently, use GetRelationship and ChangeFriendship.

Rotation constants

Summary

The Direction2 that this person is currently facing in

Skills constants

Summary

This person's Skill data. To access this collection efficiently, use GetSkill, GetSkillLevel and GainSkill.

WornLayers constants

Summary

The ClothesLayer flags that represent what layers this person is currently wearing. Note that this value is not saved to disk, and is reset to ~0 (every layer) every Update frame.

AllActions property

Summary

A concatenation of CurrentActions and ActionQueue that represents all actions that the current person has knowledge about

CurrentEmote property

Summary

The Emote that this person is currently displaying. Use DisplayEmote to modify this property.

CurrentRoom property

Summary

The Room that this person is currently in

CurrentRoomDecorativeRating property

Summary

The decorative rating of the CurrentRoom, resulting from the DecorativeRating of the contained furniture

DrawSize property

Summary

The size, in draw space pixels, that this person's texture takes up. This is gathered from the Body layer of its texture data.

EmoteTime property

Summary

The amount of time left for displaying CurrentEmote. Use DisplayEmote to modify this property.

Emotion property

Summary

The EmotionType that this person currently has, resulting from their current EmotionModifiers

FullName property

Summary

This person's full name, which is a concatenation of their FirstName and LastName.

Household property

Summary

The Household that this person is a part of

Job property

Summary

The Job that this person currently has. To edit this value, use SetJob.

LastVisitedLot property

Summary

The Lot that was last visited by this person. A visited lot is a lot that was actively moved to using VisitLotAction, GoHomeAction or if the person is currently occupying this lot. To modify this value, use VisitLot.

LotVisitCooldown property

Summary

The amount of time that has to pass before this person can visit another lot. If LastVisitedLot is set using VisitLot, this value will be set to 2 hours or 4 hours of in-game time, based on whether the visited lot is their home lot or not.

OccupiedActionSpot property

Summary

The ActionSpot of the OccupiedFurniture that this person is currently occupying. Note that this value is not saved to disk, and is reset to null every Update frame. To edit this value, use OccupyActionSpot.

OccupiedFurniture property

Summary

The Furniture that this person is currently occupying. Note that this value is not saved to disk, and is reset to null every Update frame. To edit this value, use OccupyActionSpot.

VisualPosition property

Summary

The visual position of this person, which, if nonnull, will override Position as the position that this person is looking to be in. Note that the visual position does not affect collision detection or interactions. Also note that this value is not saved to disk, and is reset to null every Update frame. To edit this value, use OccupyActionSpot.

AddEmotion(type,amount,time) method

Summary

Adds the given EmotionModifier with the given intensity and time

Returns

Whether the emotion could be added or it was already applied

Parameters
Name Type Description
type TinyLife.Emotions.EmotionModifier The type of emotion to add
amount System.Int32 The intensity of the emotion to add
time System.TimeSpan The amount of in-game time the emotion should last for

CanWalkHere(map,currPos,nextPos) method

Summary

Returns whether a Person can walk between the currPos and the nextPos. Note that, since method does not do any pathfinding, the two positions passed have to be adjacent or directly diagonal to each other.

Returns

Whether there is an obstruction (false) or the person can walk there (true)

Parameters
Name Type Description
map TinyLife.World.Map The map
currPos Microsoft.Xna.Framework.Point The current position
nextPos Microsoft.Xna.Framework.Point The position that should be walked to

CancelAction(action,cancelSource,force) method

Summary

Tries to cancel the given action, removing it from CurrentActions or ActionQueue in the process. If the action in question cannot be canceled, this method returns false.

Returns

Whether the action could be canceled successfully

Parameters
Name Type Description
action TinyLife.Actions.Action The action to cancel
cancelSource TinyLife.Actions.Action The action that is responsible for this cancelation, or null by default
force System.Boolean Whether to cancel the action even if CanCancel returns false

ChangeFriendship(person,amount) method

Summary

Changes the FriendLevelRelationship wit the given person by the given amount. Additionally, a friendship Particle is displayed and a Notifications is displayed if the friendship type changes.

Parameters
Name Type Description
person TinyLife.Objects.Person The person to change friendship with
amount System.Single The amount to change friendship by, can be negative

ChangeRomance(person,amount) method

Summary

Changes the RomanceLevelRelationship wit the given person by the given amount. Additionally, a romance Particle is displayed.

Parameters
Name Type Description
person TinyLife.Objects.Person The person to change romance with
amount System.Single The amount to change romance by, can be negative

CleanUpForDeletion() method

Summary

Cleans this person's data up to ready this person for deletion. This removes the person from its Household and removes all Relationships from other people that are associated with this person.

Parameters

This method has no parameters.

DepleteNeed(type,amount,speed) method

Summary

Depletes this person's Need with the given NeedType by the given amount Note that, when the "NoNeed" cheat is active, this method does nothing.

Parameters
Name Type Description
type TinyLife.NeedType The type of need to deplete
amount System.Single The amount to deplete the need by
speed TinyLife.GameSpeed The speed that the need depletion should be influenced by

Die(reason,createGravestone) method

Summary

Causes this person to die, removing it from the world and optionally spawning a Gravestone. Note thta this method's content is executed at the end of the current Update frame, and not right away.

Parameters
Name Type Description
reason TinyLife.Objects.Person.DeathReason The reason for this person's death
createGravestone System.Boolean Whether or not to create a gravestone

DisplayEmote(possibleCategories) method

Summary

Causes this person to display a Emote over its head for 1 to 3 seconds

Parameters
Name Type Description
possibleCategories TinyLife.Actions.EmoteCategory A combined flag that represents the categories to pick emotes from

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

DrawUi(batch,pos,scale) method

Summary

Renders this person on a ui level rather than a world level

Parameters
Name Type Description
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
pos Microsoft.Xna.Framework.Vector2 The position, in screen space, to draw at
scale System.Single The scale to draw with

EnqueueAction(type,info,automatic,variety,priority,force) method

Summary

Enqueues the given action into ActionQueue to be executed later.

Returns

The created action, or null if the action cannot be executed

Parameters
Name Type Description
type TinyLife.Actions.ActionType The type of action to enqueue
info TinyLife.Actions.ActionInfo The action information
automatic System.Boolean Whether this action is considered to have started automatically (or envoked by a player)
variety System.Nullable{TinyLife.Actions.ActionVariety} The variety of the action to start, or null if this action has no varieties
priority System.Boolean Whether to add this action to the start of the action queue rather than the end
force System.Boolean Whether to start the action even if CanExecute returns false

FindPathAsync(start,goal,costFunction,allowDiagonals) method

Summary

Finds a path asynchronously using the A* pathfinding algorithm. Note that the found path is not automatically embarked on. Usually, this method should not be used, but GoHereAction should be used instead.

Returns

A task that, when completed, returns the path found or an empty stack if there is none

Parameters
Name Type Description
start Microsoft.Xna.Framework.Point The start tile position
goal Microsoft.Xna.Framework.Point The goal tile position
costFunction MLEM.Pathfinding.AStar{Microsoft.Xna.Framework.Point}.GetCost The function to use for determining the cost of tiles
allowDiagonals System.Nullable{System.Boolean} Whether diagonal movement should be allowed

GainSkill(type,amount,speed) method

Summary

Causes this person to gain the skill with the given SkillType and raises it by the given amount. Note that PersonalityTypes influence the skinn gain automatically.

Parameters
Name Type Description
type TinyLife.Skills.SkillType The type of skill to gain
amount System.Single The amount of skill points to gain
speed TinyLife.GameSpeed The speed with which the skill gain should be influenced

GetCategories() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetFreeTalkingSpot(personComingToMe) method

Summary

Returns an ActionInfo for a location that this person can be talked to from. This method returns the best possible location from GetFreeTalkingSpots as an ActionInfo.

Returns

An action info representing a free talking spot, or null if there is none

Parameters
Name Type Description
personComingToMe TinyLife.Objects.Person The person that wants to talk to this person

GetFreeTalkingSpots() method

Summary

Returns a set of locations, in world space, that this person can be talked to from while standing in its current location

Returns

A set of free talking spots

Parameters

This method has no parameters.

GetHeldActionInfo() method

Summary

Returns a ActionInfo for the GetHeldObject``1, or null if there is none.

Returns

The held action info

Parameters

This method has no parameters.

GetHeldObject``1() method

Summary

Returns the Furniture that this person is currently holding in their hands. Note that, if the held object is not of the required type T, null is returned.

Returns

The held furniture

Parameters

This method has no parameters.

Generic Types
Name Description
T The type that the held furniture is expected to have

GetHomeLocation() method

Summary

Shorthand method for GetHomeLocation that returns the home location of this person's Household's lot

Returns

This person's home location

Parameters

This method has no parameters.

GetHoverInfo() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetNeed(type) method

Summary

Returns the NeedValue of the given type for this person

Returns

This person's need value

Parameters
Name Type Description
type TinyLife.NeedType The type of need that should be returned

GetNeedPercentage(type) method

Summary

Returns the NeedPercentage of the given type for this person

Returns

This person's need percentage

Parameters
Name Type Description
type TinyLife.NeedType The type of need that should be returned

GetRelationship(person,initialize) method

Summary

Returns the current relationship level for the given Person. Note that this returns this person's Relationships entry, which might have different values from the passed Person's.

Returns

The relationship, or null if there is none and initialize is false

Parameters
Name Type Description
person TinyLife.Objects.Person The person to get relationship values for
initialize System.Boolean Whether a new relationship should be added to the relationships menu if no relationship exists yet

GetRelationshipType(person) method

Summary

Returns the RelationshipType that this person has to the given Person. This is a helper method that returns the relationship type of GetRelationship, or Acquaintances if there is no relationship.

Returns
Parameters
Name Type Description
person TinyLife.Objects.Person

GetSkillLevel(type) method

Summary

Returns the level of the Skill of the given type that this person has. If this person does not have the given skill, 0 is returned.

Returns

The person's skill level

Parameters
Name Type Description
type TinyLife.Skills.SkillType The type of skill to query

HasPersonality(type) method

Summary

Returns whether this person has the given PersonalityType

Returns

true if this person has this personality type, false otherwise

Parameters
Name Type Description
type TinyLife.PersonalityType The personality type to query

HasSkillLevel(type,level) method

Summary

Returns whether this person has a Skill of the given type and whether its value is high enough.

Returns

true if the person has this skill level, false otherwise

Parameters
Name Type Description
type TinyLife.Skills.SkillType The type of skill to query
level System.Int32 The level that the skill has to be

Intersects() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

IsCloseForTalking(pos) method

Summary

Returns true if pos is considered close enough for talking. For a person to be close enough for talking, they have to be at least 0.25 and at most 2.5 tiles away.

Returns

Whether the person is close enough to talk to

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Vector2 The position of the person to query closeness for

LowerEmotion(type,percentage,speed) method

Summary

Lowers any EmotionModifiers of the given EmotionType by the given percentage. Each modifier's Time will be lowered by the percentage of their TotalTime.

Returns

Whether the emotion could be lowered, or this person had no emotion modifiers of the given type

Parameters
Name Type Description
type TinyLife.Emotions.EmotionType The type of emotion to lower
percentage System.Single The percentage to lower the emotion by
speed TinyLife.GameSpeed The game's current speed, or Regular by default

OccupyActionSpot(furniture,spot,enterSpot,rotation) method

Summary

Causes the given action spot of the given furniture to be marked as occupied. Optionally, the VisualPosition can also be changed, causing this person to look as if they were sitting, standing or laying on the furniture. Note that the values set in this method are reset every Update call.

Parameters
Name Type Description
furniture TinyLife.Objects.Furniture The furniture to occupy
spot TinyLife.Objects.ActionSpot The action spot to occupy on the furniture
enterSpot System.Boolean Whether or not the visual position should be updated to enter the spot
rotation System.Nullable{MLEM.Misc.Direction2} The rotation that this person should get, or null to use the spot's default rotation

RemoveEmotion(type) method

Summary

Removes the given EmotionModifier from this person's EmotionModifiers

Returns

Whether the emotion could be removed (or wasn't contained in the first place)

Parameters
Name Type Description
type TinyLife.Emotions.EmotionModifier The type of emotion to remove

ResetToStatic(resetRelationships) method

Summary

Resets this person to a static version of itself. This action clears AllActions, clears the LastVisitedLot, resets all Relationships and restores all Needs to their default value. This method is used by map and household ex- and imports.

Parameters
Name Type Description
resetRelationships System.Boolean Whether or not relationships should be reset or not

RestoreNeed(type,amount,speed) method

Summary

Restores this person's Need of the given type by the given amount

Parameters
Name Type Description
type TinyLife.NeedType The type of need to restore
amount System.Single The amount to restore this need by
speed TinyLife.GameSpeed The speed that the need gain should be influenced by

SetHeldObject(furniture) method

Summary

Sets this person's held object to the given instance. Note that this resets the Furniture's position to -1, -1.

Parameters
Name Type Description
furniture TinyLife.Objects.Furniture The furniture to hold

SetHeldObject``1(type,colors,id) method

Summary

Sets the person's held object to the given furniture type, with the given data, and returns the created instance.

Returns

The created furniture instance

Parameters
Name Type Description
type TinyLife.Objects.FurnitureType The type of furniture to construct
colors System.Int32[] The colors that the constructed furniture should have, or null to use the defaults
id System.Nullable{System.Guid} The id that this furniture should have, or null to choose a random one
Generic Types
Name Description
T The type that the created furniture is expected to have

SetJob(type) method

Summary

Sets this person's current Job. If null is passed, the person's job gets removed.

Parameters
Name Type Description
type TinyLife.Goals.JobType The job to start

StopEmoting() method

Summary

Causes this person to stop displaying the current emote immediately

Parameters

This method has no parameters.

ToCreatedByString() method

Summary

Returns a string representation of this person using the localized "Created by:" prefix

Returns

A "created by" string

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

VisitLot(lot) method

Summary

Marks the given lot as visited, setting LotVisitCooldown to 4 hours if the lot is the person's home lot, and 2 otherwise The passed lot is additionally marked as visible using MarkLotVisible,

Parameters
Name Type Description
lot TinyLife.World.Lot The lot to mark as visited

PersonAi type

Namespace

TinyLife.Objects

Summary

This class holds the artificial intelligence implementation for a Person. The AI automatically selects actions based on their AiSettings.

PersonalityType type

Namespace

TinyLife

Summary

A personality type is a trait that a Person can have. Each personality type is meant to influence the person's behavior and abilities slightly in a certain way.

#ctor(name,texture,disallowedOthers) constructor

Summary

Creates a new personality type with the given name

Parameters
Name Type Description
name System.String The name of this personality type
texture MLEM.Textures.TextureRegion The icon texture for this personality type
disallowedOthers TinyLife.PersonalityType[] A set of personality types that cannot be applied together with this one

AmountPerPerson constants

Summary

The amount of personality types that each Person can have

DisallowedOthers constants

Summary

A set of personality types that cannot be applied together with this one

Name constants

Summary

The name of this personality type. As this is used for Types, this name needs to be unique across all installed mods.

Texture constants

Summary

The icon texture for this personality type

Types constants

Summary

A registry of all of the personality types in the game. Use Register to register custom personality types.

Register(type) method

Summary

Registers this personality type to the Types registry

Returns

The personality type, for chaining

Parameters
Name Type Description
type TinyLife.PersonalityType The personality type to register

PlayModeTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

SelectedPerson property

Summary

Stores the Person that is currently selected

Closed() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Opened() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Pose type

Namespace

TinyLife.Objects.Person

Summary

An enumeration that represents a set of poses that a Person can display

Laying constants

Summary

A pose that represents a person who is lying down. Note that the default textures for this pose only contain the upper body and head.

Sitting constants

Summary

A pose that represents a sitting person

SittingLegsClose constants

Summary

A pose that represents a person who is sitting, but with their legs close to their body. This pose is mainly used for the "passed out" stance.

Standing constants

Summary

A pose that represents a standing person

Walking constants

Summary

A pose that represents a person animated to look like they're walking

WorkingSitting constants

Summary

A pose that represents a person who is sitting and working on something

WorkingStanding constants

Summary

A pose that represents a person who is standing and working on something

Quality type

Namespace

TinyLife.Skills

Summary

An enumeration for qualitites of objects like CustomPainting. To receive a random quality based on a person's Skill level, use GetRandomQuality.

Average constants

Summary

A quality for objects that have an average quality

Good constants

Summary

A quality for objects that have good quality

Great constants

Summary

A quality for objects that have great quality

Masterpiece constants

Summary

A quality for objects that are masterpieces. When an object with this quality is created, a Notifications notification should be displayed to the user

Perfect constants

Summary

A quality for objects that are considered perfect

Terrible constants

Summary

A quality for objects that are terrible

Relationship type

Namespace

TinyLife

Summary

A relationship is a connection between two Person objects. It should be noted that a relationship is not always the same between a person and the linked OtherPerson. What this means is that A can have a good relationship to B, but B can have a less good relationship to A.

#ctor(otherPerson) constructor

Summary

Creates a new relationship to the given other person

Parameters
Name Type Description
otherPerson System.Guid The other person

Dating constants

Summary

This value is set to true if this relationship is a romantic relationship

Genealogy constants

Summary

The GenealogyType of this relationship. Note that the genealogy's value works in the following direction: "I am the [Genealogy] of [OtherPerson]". Note that OtherPerson will always have the GenealogyType's GetOpposite.

Max constants

Summary

The maximum value that a relationship level can have

PassiveFriendReduction constants

Summary

The amount of points (out of Max) that are removed from each relationship's FriendLevel each update frame

PassiveRomanceReduction constants

Summary

The amount of points (out of Max) that are removed from each relationship's RomanceLevel each update frame

DisplayString property

Summary

An (unlocalized) string that represents a written version of this relationship's status. If Dating is true, the string "Dating" will be returned. Otherwise, Type is returned as a string.

FriendLevel property

Summary

The current amount of friendship points (out of Max) that this relationship has. This value is automatically clamped between -Max and Max.

FriendPercentage property

Summary

The FriendLevel of this relationship, divided by Max, yielding a percentage between -1 and 1 of how good this friendship is

OtherPerson property

Summary

The Guid of the person that this relationship is linked to

RomanceLevel property

Summary

The current amount of romance points (out of Max) that this relationship has. This value is automatically clamped between 0 and Max.

RomancePercentage property

Summary

The RomanceLevel of this relationship, divided by Max, yielding a percentage between 0 and 1 of how good this relationship's romance level is

Type property

Summary

The RelationshipType that this relationship has, based on the current FriendLevel.

RelationshipType type

Namespace

TinyLife

Summary

An enumeration type that represents the type that a Relationship can have

Acquaintances constants

Summary

A relationship type that represents two people that don't know each other well

Disliked constants

Summary

A relationship type that represents two people that dislike each other

Enemies constants

Summary

A relationship type that represents two people that hate each other

Friends constants

Summary

A relationship type that represents two people that know each other well

GoodFriends constants

Summary

A relationship type that represents two people that know each other very well

RemoveTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetMouseCursor() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Roof type

Namespace

TinyLife.World

Summary

A roof is an object on a Map that is on a higher level and cannot be interacted with by people

#ctor(type,area,rotation,color) constructor

Summary

Creates a new roof with the given settings

Parameters
Name Type Description
type TinyLife.World.RoofType The type of the roof
area Microsoft.Xna.Framework.Rectangle The area that this roof covers
rotation MLEM.Misc.Direction2 This roof's rotation
color System.Int32 The color that this roof's wallpaper should have

Area constants

Summary

The area that this roof covers

Color constants

Summary

The color index in in WarmDark that this roof uses for its top

Type constants

Summary

The RoofType that this roof has

Wallpaper constants

Summary

The Wallpaper that is applied to this roof. This defaults to the Default wallpaper.

Rotation property

Summary

The rotation that this roof has. This is only relevant for roofs that don't have the Flat type.

Draw(time,batch,map,type,area,rotation,colorIndex,wallpaper,depthOffset) method

Summary

Draws the given Roof in world space

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's current time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
map TinyLife.World.Map The map to draw on
type TinyLife.World.RoofType The type of roof to draw
area Microsoft.Xna.Framework.Rectangle The area the roof covers
rotation MLEM.Misc.Direction2 The roof's rotation
colorIndex System.Int32 The color index in WarmDark
wallpaper TinyLife.World.Wallpaper The wallpaper applied to the roof
depthOffset System.Single The value that should be added to the depth of this roof

DrawUi(batch,element,type,colorIndex,drawScale) method

Summary

Draws a Roof in ui space, only drawing a 1x1 area of it

Parameters
Name Type Description
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
element MLEM.Ui.Elements.Element The element to draw the roof on
type TinyLife.World.RoofType The type of roof to draw
colorIndex System.Int32 The color index in WarmDark
drawScale System.Single The scale to draw the roof with

GenerateRoof(room) method

Summary

Generates the roofing for the given Room and adds it to the map. The generated roofing is split into as few separate parts as possible by ordering the tiles the room covers.

Parameters
Name Type Description
room TinyLife.World.Room The room to add roofing to

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetPriceByType(type) method

Summary

Returns the price of the given RoofType

Returns

The price for the roof type

Parameters
Name Type Description
type TinyLife.World.RoofType The type of roof to query

RoofTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ForceWallsUp() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

InitBuildModeUi() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

RoofType type

Namespace

TinyLife.World

Summary

An enumeration that represents the various types that a Roof can have

Flat constants

Summary

A flat roof that no Wallpaper is attached to

Gable constants

Summary

A gabled roof that becomes higher the longer it is, and that Wallpaper can be attached to

Room type

Namespace

TinyLife.World

Summary

A room is an area on a Map that is surrounded by Wall objects

Center constants

Summary

The position that is considered to be the center of this room. This is the average of all of its covered Tiles, and the MapSection that this room is on is determined by this value.

CoveredSections constants

Summary

A set of MapSection instances that are covered by this room

Map constants

Summary

The map that this room is on

Tiles constants

Summary

A set of Point positions on the Map that are contained in this room

GetConnectedRooms() method

Summary

Returns a set of Room objects which are connected to this room. A connected room is a room that is directly adjacent, and that a Person can walk into through an Opening.

Returns

A set of connected rooms

Parameters

This method has no parameters.

GetDecorativeRating() method

Summary

Returns the combined decorative rating of all of the Furniture in this room. This method uses the DecorativeRating function.

Returns

The combined decorative rating

Parameters

This method has no parameters.

GetObjects``1() method

Summary

Returns all of the MapObject instances that are contained in this room

Returns

All of the objects in this room

Parameters

This method has no parameters.

GetWalls(borderOnly) method

Summary

Returns all of the Wall instances that are border walls or internal walls of this room. An internal wall is a wall for which both sides are contained in the room, rather than just one.

Returns

A set of walls and their included sides of this room

Parameters
Name Type Description
borderOnly System.Boolean Whether to return border walls only, or include internal walls

IsFullyRoofed() method

Summary

Returns whether or not this room has a Roof on all of its Tiles

Returns

Whether or not this room is fully roofed

Parameters

This method has no parameters.

IsSameRoom(tiles) method

Summary

Returns whether this room has the same covered Tiles as the given collection

Returns

true if the covered tiles are the same, false otherwise

Parameters
Name Type Description
tiles System.Collections.Generic.ICollection{Microsoft.Xna.Framework.Point} The tiles to query

Validate() method

Summary

This method is called when this object is loaded from disk.

Returns

false if the object is not valid, true otherwise

Parameters

This method has no parameters.

SellAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

AndThenInitialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

AndThenIsCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CreateFirstActions() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetSoldObject``1(info) method

Summary

A helper method that returns the object that is being sold. This method returns the action object or the person's held object.

Returns

The object, or null if there is none or it doesn't match the type

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
Generic Types
Name Description
T The type that the object is expected to be

SitAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

AndThenInitialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

AndThenIsCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

AndThenUpdate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CanMultitask() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CreateFirstActions() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

SitAtDeskObjectAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

AndThenUpdate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CreateFirstActions() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetChair(info) method

Summary

Helper method that returns GetChair for the action object of the given action info.

Returns

The chair

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info

GetChairSpot(info) method

Summary

Helper method that returns the first valid action spot of the chair returned in GetChair

Returns

An action info, or null if there is none or there is no chair

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info

GetNextAction() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Skill type

Namespace

TinyLife.Skills

Summary

A skill is an ability that a Person can have which influences their behavior in some way. Skill instances are created from their corresponding SkillType.

#ctor(type) constructor

Summary

Creates a new skill instance from the given SkillType.

Parameters
Name Type Description
type TinyLife.Skills.SkillType The type of skill to construct

Type constants

Summary

The underlying SkillType that this skill instance originates from

Level property

Summary

The current level of this skill. Note that this value never goes beyond MaxLevel. To modify this value, use Gain or GainSkill.

PointPercentage property

Summary

The percentage of PointsToNextLevel out of the required GetRequiredPointsToNextLevel. Obviously, this value goes between 0 and 1.

PointsToNextLevel property

Summary

The amount of skill points that are required until the next Level is reached. To modify this value, use Gain or GainSkill.

Gain(person,amount) method

Summary

Causes the given person to gain a certain amount of points of this skill. Note that GainSkill is preferred to this method.

Parameters
Name Type Description
person TinyLife.Objects.Person The person that has this skill
amount System.Single The amount to gain the skill by

GetRequiredPointsToNextLevel() method

Summary

Returns the amount of skill points that is required to reach the next level. This value is depenedent on the current Level, meaning higher skill levels are harder to reach.

Returns

The points required for the next level

Parameters

This method has no parameters.

SkillCategory type

Namespace

TinyLife.Skills

Summary

A flag enumeration that determines the categories that a SkillType has

Creative constants

Summary

A skill category for skills that require creativity. Skills in this category are boosted by the Creative personality type.

Logical constants

Summary

A skill category for skills that require logical thinking

None constants

Summary

A skill category for skills that fit into none of the other categories

Social constants

Summary

A skill category for skills that are related to social interaction. Skills in this category are boosted by the Likeable and Mean personality types.

SkillType type

Namespace

TinyLife.Skills

Summary

A skill is an ability that a Person can have which influences their behavior in some way. The SkillType class contains underlying data for a Skill instance, like its name and maximum level.

#ctor(name,texture,maxLevel,categories) constructor

Summary

Creates a new skill type with the given settings

Parameters
Name Type Description
name System.String The skill's name
texture MLEM.Textures.TextureRegion The skill's icon
maxLevel System.Int32 The skill's maximum level. Should be 5 or 10 for consistency.
categories TinyLife.Skills.SkillCategory A combined flag of categories that this skill has

Categories constants

Summary

The SkillCategory combined flag that this skill type has. The skill categories it has are used to determine skill gain from things like the Creative personality type.

MaxLevel constants

Summary

The maximum level that this skill can reach. Most skills should default to 5 or 10 for consistency.

Name constants

Summary

The name of this skill type

Texture constants

Summary

The texture region of this skill type's icon

Types constants

Summary

A registry of all skill types that exist in the game and mods. Use Register to register custom skill types.

GetRandomQuality(person,random,modifyEmotions) method

Summary

Returns a semi-randomly generated Quality for the given Person based on their level of this skill. The higher the skill level is, the more likely it is for higher qualities to be returned.

Returns

A random quality based on the person's skill level

Parameters
Name Type Description
person TinyLife.Objects.Person The person that has this skill
random System.Random The random that should be used for calculation
modifyEmotions System.Boolean Whether the given person should receive emotions based on the quality

Register(type) method

Summary

Registers a new SkillType to the Types registry

Returns

The registered type, for chaining

Parameters
Name Type Description
type TinyLife.Skills.SkillType The type to register

SocialAction type

Namespace

TinyLife.Actions

Summary

A social action is an action that involves two Person instances. Before a social action "actually" starts, both parties have to have the action as their current action. For this to happen, the person that initiates the action follows the Partner until they reach them (or give up).

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

PartnerCompletion constants

Summary

The current completion type of the Partner's action. If this is not set, the partner completion is irrelevant for this action's completion behavior.

ConversationTime property

Summary

The amount of time that the actual conversation has been going on for. This is the total amount of time (ElapsedTime) minus the amount of time it took for the IsMainPerson to reach the Partner.

Id property

Summary

The internal id of this action

IsMain property

Summary

Whether or not this is the action that started the social interaction The PartnerAction will always have the inverse value of this value.

Partner property

Summary

The Person that we're interacting with

PartnerAction property

Summary

The SocialAction that the Partner of this action instantiated as part of the interaction

CanCancel() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

CanMultitask() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

DisplayConversationEmotes(time,speed,possibleCategories,totalEmoteAmount) method

Summary

Helper method to display emotes over each conversation partner in a back and forth fashion to make it seem like they are conversing

Returns

If totalEmoteAmount is set, true is returned if the emote back-and-forth is completed

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current game time
speed TinyLife.GameSpeed The game's current speed
possibleCategories TinyLife.Actions.EmoteCategory A combined flag representing the categories that emotes can be picked from
totalEmoteAmount System.Int32 The total amount of emotes that should be shown (not per person, but in total)

GetDisplayName() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetTimeWeWaitForPartner() method

Summary

Returns the amount of time that the Person should wait for their Partner for before the interaction is canceled. By default, this method returns 30 minutes if the PartnerIsCloseForTalking, and 15 minutes otherwise.

Returns

The amount of in-game time that this person should wait for their partner

Parameters

This method has no parameters.

Initialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

InitializeConversation() method

Summary

SocialAction version of Initialize. This method is called when the conversation part of this action first starts. By default, this method does nothing.

Parameters

This method has no parameters.

InvokeForBoth(action) method

Summary

Invokes the given action for both the Person and the Partner, passing both of them in the following way:

action(Person, Partner);
action(Partner, Person);
Parameters
Name Type Description
action System.Action{TinyLife.Objects.Person,TinyLife.Objects.Person} The action to invoke for both people of this conversation

IsCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

IsConversationCompleted() method

Summary

SocialAction version of IsCompleted. This method returns whether or not the conversation should be marked as completed. Note that this method is only called for the IsMain part of the conversation.

Returns

Whether or not this conversation is completed

Parameters

This method has no parameters.

OnCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

UpdateConversation(time,passedInGame,speed) method

Summary

SocialAction version of Update. This method is called every update frame during an active conversation. By default, this method only increases ConversationTime.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
passedInGame System.TimeSpan The amount of time passed in game time
speed TinyLife.GameSpeed The current game speed

Validate() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

StaticJsonConverter`1 type

Namespace

TinyLife.Utilities

Summary

A JsonConverter`1 that doesn't actually serialize the object, but instead serializes the name given to it by the underlying Dictionary`2.

Generic Types
Name Description
T The type of the object to convert

#ctor(entries) constructor

Summary

Creates a new static json converter using the given underlying Dictionary`2.

Parameters
Name Type Description
entries System.Collections.Generic.Dictionary{System.String,`0} The dictionary to use

ReadJson() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

WriteJson() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

TalkAction type

Namespace

TinyLife.Actions

Summary

TalkAction is a generic social action with a set of pre-defined parameters. Things like PersonalityType and Charisma automatically influence this interaction's FriendshipGain and GoBadlyChance. Create should be used to create a talk action.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Settings property

Summary

The TalkSettings for this action, derived from its type's settings

Create(name,priority,settings) method

Summary

A helper method to create a TalkAction, which is a very simple implementation of a SocialAction

Returns

A new TypeSettings instance with the given settings, which initializes a TalkAction when constructed

Parameters
Name Type Description
name System.String The name of the action
priority System.Func{TinyLife.Objects.Person,System.Int32} The passive priority of this action
settings TinyLife.Actions.TalkAction.TalkSettings The additional settings for this action

IsConversationCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

UpdateConversation() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

TalkSettings type

Namespace

TinyLife.Actions.TalkAction

Summary

Additional settings for TalkAction, used by Create

CanExecute constants

Summary

A function that returns whether this action can currently be executed. If this is null, the action can always be executed (if the RequiredSkill is present).

EmoteCategory constants

Summary

The category of emotes that should be displayed as part of this conversation

FailEmotion constants

Summary

A EmotionModifier that is added to the person if this talk action fails. The talk actions fails if the GoBadlyChance has been randomly reached.

FriendshipGain constants

Summary

The amount of friendship that can be gained at max

GainRomancePercentage constants

Summary

A function that returns what percentage (between 0 and 1) of FriendshipGain is added to the relationship as RomanceLevel rather than FriendLevel. If an interaction is romantic in nature, this function should return a value greater than 0. If this function is null, 0% of the friendship gain will be romantic.

GainSkillOnFailure constants

Summary

Whether the GainSkillOnFailure should be gained on failure rather than success. This is useful for skills that are considered "mean", where the gained skill is mischievious etc.

GainedSkill constants

Summary

The skill that is gained if this conversation goes well. Higher levels in this skill also reduce the chance of the conversation going badly.

GainedSkillAmount constants

Summary

The amount of the GainedSkill that is gained

GoBadlyChance constants

Summary

The chance (from 0 to 1) that this action goes badly and friendship is reduced instead

LoweredEmotion constants

Summary

An EmotionType that is lowered when this action is successful for both conversation partners. This uses LowerEmotion internally. Note that this value only has an effect if LoweredEmotionAmount is greater than 0.

LoweredEmotionAmount constants

Summary

The amount that LoweredEmotion is lowered by when this action is successful for both conversation partners. Note that this value only has an effect if LoweredEmotion is non-null.

OnFailure constants

Summary

An action that is invoked when this talk action fails

OnSuccess constants

Summary

An action that is invoked when this talk action succeeds

RequiredEmotion constants

Summary

The EmotionType that is required for this action to be available

RequiredSkill constants

Summary

The Skill that is required for this action to be available

RequiredSkillLevel constants

Summary

The skill level of RequiredSkill that is required for this action to be available

RestoredNeed constants

Summary

The need (alongside Social) that is restored during the conversation

RestoredNeedAmount constants

Summary

The amount of RestoredNeed that is restored each update frame

TalkMinutes constants

Summary

The amount of in-game minutes that this action should last

CheckCanExecute(info,automatic) method

Summary

Checks whether this TalkSettings instance is currently able to be executed. This takes into account all of the parameters, including CanExecute, RequiredSkill and RequiredEmotion.

Returns

The execution validity result

Parameters
Name Type Description
info TinyLife.Actions.ActionInfo The action info
automatic System.Boolean Whether this action is automatic

Evaluate(action) method

Summary

Evaluates these TalkSettings after a TalkAction has completed. This method causes friendship and romance to be added to the involved people's Relationship, adds the GainedSkill etc. This method is automatically called in TalkAction.

Parameters
Name Type Description
action TinyLife.Actions.SocialAction The action

TellPeopleToLeaveRoomAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

ExcludedPeople constants

Summary

A list of Guid ids of Person objects that should not be asked to leave the room

Initialize() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

IsCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

OnCompleted() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

TextureHandler type

Namespace

TinyLife.Utilities

Summary

The texture handler stores data for the game's textures, including all of the game's internal textures and various utility methods. It also stores the game's RuntimeTexturePacker which is used to pack all textures into a big texture for performance.

ApplyWallpaperMasks(wallpapers,regionAmountX,regionAmountY,result) method

Summary

Applies the game's predefined wallpaper maskings (based on WallMode) to the given wallpaper texture. When adding custom Wallpaper types, this method should be used. Note that, as part of this method, the resulting texture is implicitly added onto the game's RuntimeTexturePacker.

Parameters
Name Type Description
wallpapers Microsoft.Xna.Framework.Graphics.Texture2D The texture to mask
regionAmountX System.Int32 The amount of texture regions on the x axis
regionAmountY System.Int32 The amount of texture regions on the y axis
result System.Action{MLEM.Textures.UniformTextureAtlas} A function that is called when the RuntimeTexturePacker packed the masked texture, which yields the resulting texture atlas

Tile type

Namespace

TinyLife.World

Summary

A tile is an object on a Map that represents the covering of the ground (or the ground itself)

BaseName constants

Summary

The name of this type of tile. Whereas Name has the index of its color appended to it, this one is just the type's name.

CanBuy constants

Summary

A field that indicates whether this tile can be bought without the "ShowNonBuyable" cheat enabled

ColorScheme constants

Summary

The color scheme that this tile can have

Height constants

Summary

The height of each tile, in pixels

Icon constants

Summary

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.

Name constants

Summary

The name of this specific tile. This is comprised of the BaseName with the color's index attached to it.

Natural constants

Summary

A field that indicates whether this tile is considered natural. A natural tile is a tile that objects with the NaturalGroundRequired category can be placed on.

PathCostModifier constants

Summary

A field that indicates the "cost" for pathfinding of this tile. The default modifier is 1, and it should not be set to a value lower than that.

Price constants

Summary

The price of this tile

ReferencePrice constants

Summary

The reference price for tiles. Since Grass is replaced by Concrete in a newly created room, the two tiles have to cost the same. This is that price. This value is set to 5.

Tiles constants

Summary

A registry of all tiles that exist in the game and its mods

Width constants

Summary

The width of each tile, in pixels

Draw(batch,drawPos,depth,scale) method

Summary

Draws this tile at the given position in the world

Parameters
Name Type Description
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
drawPos Microsoft.Xna.Framework.Vector2 The position, in screen space, to draw at
depth System.Single The depth to use for drawing
scale System.Single The scale to draw the tile with

DrawUi(e,batch,drawScale) method

Summary

Draws this tile on the given ui element, in ui space

Parameters
Name Type Description
e MLEM.Ui.Elements.Element The element to draw on
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to use for drawing
drawScale System.Single The scale to draw the tile with. Defaults to 0.4.

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Register(name,price,textureRegion,colors,pathCostModifier,canBuy,natural,icon) method

Summary

Registers a new tile with the given settings

Parameters
Name Type Description
name System.String The name that the tile should have
price System.Int32 The tile's price
textureRegion MLEM.Textures.TextureRegion The texture region that this tile should use for rendering
colors TinyLife.Utilities.ColorScheme The color scheme that this tile should have
pathCostModifier System.Single The path cost modifier, >= 1, that this tile should have
canBuy System.Boolean Whether or not the tile can be bought in the tile tool
natural System.Boolean Whether or not the tile is considered natural ground
icon MLEM.Textures.TextureRegion The build mode category icon of this object

TileTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetMouseCursor() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

InitBuildModeUi() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Tool type

Namespace

TinyLife.Tools

Summary

A tool is a type of game mode that is currently active. Tools are split up into the PlayModeTool and BuildTools, the latter of which holds all tools that can be found in the build menu.

#ctor(texture,displayAsTab) constructor

Summary

Creates a new tool with the given settings

Parameters
Name Type Description
texture MLEM.Textures.TextureRegion The texture of the tool icon
displayAsTab System.Boolean Wheteher or not this tool should display as a tab. Defaults to false.

BuildTools constants

Summary

A set of Tool instances that can be activated using the build mode menu. All tools in this list are automatically added to the menu.

DisplayAsTab constants

Summary

Whether or not this tool should be displayed as a tab (like the RemoveTool) or a button in the build menu

MousePos constants

Summary

The position of the mouse in world coordinates. This position is set every Update call.

MoveTool constants

Summary

The MoveTool singleton

PlayModeTool constants

Summary

The PlayModeTool singleton, which is activated when build mode is inactive.

RemoveTool constants

Summary

The RemoveTool singleton, which is activated using the Remove tab in the build menu or by holding the control key.

Texture constants

Summary

The texture region that should be used to display this tool in the build menu

Input property

Summary

Inherit from parent.

Map property

Summary

Inherit from parent.

Money property

Summary

Inherit from parent.

SelectedObject property

Summary

The MapObject that is currently below the mouse, or null if there is none. This object selection mechanic uses pixel-perfect collision based on the object's rendered texture.

BuildModeButton(name,onPressed,onDrawn,price,icon) method

Summary

Creates a new Button in the style of each build mode content button, like the ones that display the furniture that can be bought.

Returns

A new button with the passed settings

Parameters
Name Type Description
name System.String The name that should be displayed when hovering the button. This should be unlocalized.
onPressed MLEM.Ui.Elements.Element.GenericCallback A fucntion that is called when the created button is pressed
onDrawn MLEM.Ui.Elements.Element.DrawCallback A function that is called when the created button is drawn
price System.Single The price that should be displayed for this object
icon MLEM.Textures.TextureRegion The build mode category icon of this object

CanSaveOrSwitchModes() method

Summary

Whether or not the game CanSaveOrSwitchModes currently, while this tool is selected

Returns

Whether the game can be saved or mode switched right now

Parameters

This method has no parameters.

Closed() method

Summary

Called when this build tool is closed. By default, this method removes its elements from the ui.

Parameters

This method has no parameters.

ColorSelection(colors,onPressed) method

Summary

Creates a new Group that resembles a set of color selection buttons. This is used by CharacterCreator, as well as tools like the FurnitureTool.

Returns

A group of buttons with the given settings

Parameters
Name Type Description
colors TinyLife.Utilities.ColorScheme The color scheme to create buttons for
onPressed System.Action{System.Int32} A function that returns the index of the button (and color) that has been pressed

Draw(time,batch) method

Summary

This method is called every draw frame for the CurrentTool. Note that this method is only called if the mouse is not hovering over any ui elements.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch used for drawing

ForceWallsUp() method

Summary

Returns whether the WallDisplay should be forcibly changed by this tool. If it shouldn't be changed, null should be returned. Otherwise, the required WallDisplay should be returned.

Returns

The required wall display, or null if the default should be used

Parameters

This method has no parameters.

GetClosestWallDirection(hoveredPos) method

Summary

Returns the direction of the wall that the mouse position is currently closest to.

Returns

The closest wall direction, or Up if there is none

Parameters
Name Type Description
hoveredPos Microsoft.Xna.Framework.Point The position that the mouse is on, in world space

GetMouseCursor() method

Summary

Returns the CursorType that this tool should currently display. By default, Default is returned.

Returns

The cursor type

Parameters

This method has no parameters.

InitBuildModeUi(content,zoom) method

Summary

Override this method to add custom content to the passed ui elements. By default, this method does nothing.

Parameters
Name Type Description
content MLEM.Ui.Elements.Panel The main content panel. Add custom BuildModeButton instances here.
zoom MLEM.Ui.Elements.Panel The zoom panel that contains ColorSelection and object previews

IsOnLot(pos) method

Summary

Returns whether or not the passed position is on the currently edited lot (CurrentLot)

Returns

Whether or not the position is on the current lot

Parameters
Name Type Description
pos Microsoft.Xna.Framework.Point The position to check

Opened() method

Summary

Called when this build tool is opened. By default, this method initializes several settings and calls InitBuildModeUi.

Parameters

This method has no parameters.

Update(time) method

Summary

This method is called every update frame for the CurrentTool.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The game's time

TypeCategory type

Namespace

TinyLife.Emotions.EmotionType

Summary

An enumeration used for Category that represents a general category an emotion can fit into. The values are ordered in a way such that, if two emotion amounts sum to the same value, the one with the lower category will be chosen.

Negative constants

Summary

A negative emotion, like Sad or Embarrassed

Neutral constants

Summary

A neutral emotion, like Fine or Asleep

Positive constants

Summary

A positive emotion, like Happy

TypeSettings type

Namespace

TinyLife.Actions.ActionType

Summary

A struct that contains information about an ActionType

TypeSettings type

Namespace

TinyLife.Objects.FurnitureType

Summary

A set of settings that define the properties of a FurnitureType

#ctor(name,context,construct) constructor

Summary

Creates a new type settings instance with the given values

Parameters
Name Type Description
name System.String The name of this action type
context TinyLife.Objects.ObjectCategory A combined ObjectCategory flag that represents all of the objects that this action can be executed on
construct System.Func{TinyLife.Actions.ActionType,TinyLife.Actions.ActionInfo,TinyLife.Actions.Action} A function that is called in Construct to create a new action instance.

#ctor(name,size,categories,price,colorSchemes) constructor

Summary

Initializes a new TypeSettings instance with the given data

Parameters
Name Type Description
name System.String The name that this furniture type should have
size Microsoft.Xna.Framework.Point The size that this furniture type should have
categories TinyLife.Objects.ObjectCategory The categories that this furniture type should have
price System.Single The price of this furniture type
colorSchemes TinyLife.Utilities.ColorScheme[] The color schemes that this furniture type should have. Cannot be empty.

Ai constants

Summary

A set of settings for PersonAi invocation of this action. This value defaults to default.

CanExecute constants

Summary

A delegate that returns a CanExecuteResult based on whether the given situation allows this action to be executed. This value is initialized always return Valid.

Construct constants

Summary

A function that is called in Construct to create a new action instance. This should return a new instance of your custom type that extends Action.

Context constants

Summary

A combined ObjectCategory flag that represents all of the objects that this action can be executed on

IconName constants

Summary

The name of the icon that this action type should display in front of its name. To make the icon work, its name needs to be added to the UiSystem's TextFormatter using AddImage.

IsInappropriateElsewhere constants

Summary

If this value is true, this action will not automatically be invoked by PersonAi on lots that the person does not own. Additionally, when the player invokes an action with this value set to true, the lot's owner will come up to them and tell them to stop.

Name constants

Summary

The name of this action type

Texture constants

Summary

The texture region used in the top left action queue display in-game. If this value is null, GetIconObject is used for the icon instead.

Varieties constants

Summary

A set of ActionVariety instances that represent different versions of this action. If this is set, a menu pops up (like when cooking food) that displays all of the varieties as options to the user. When the PersonAi invokes an action with a variety, it chooses a variety randomly based on its PassivePriority

ActionSpots constants

Summary

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.

BuyableVariations constants

Summary

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 FoodPlate and CustomPainting.

Categories constants

Summary

A set of ObjectCategory flags that this furniture should have

ColorMap constants

Summary

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.

ColorSchemes constants

Summary

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.

Construct constants

Summary

A delegate to a Construct method that is invoked when this furniture type is instantiated using Construct

DecorativeRating constants

Summary

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 EmotionModifier values like UglySurroundings. 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.

DefaultColors constants

Summary

The default color selection for this furniture type. If not specified, this defaults to the first entries in each of the ColorSchemes.

DefaultRotation constants

Summary

The rotation that this furniture type should have when picked from the FurnitureTool. Up by default.

HeldScale constants

Summary

The scale that this furniture should be drawn with when held by a Person

Icon constants

Summary

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.

Name constants

Summary

The name of the furniture type. Should be unique across all game content, including all mods.

ObjectSpots constants

Summary

An array of ObjectSpot instances that this furniture type should have. By default, there are no object spots.

Price constants

Summary

The price that this furniture should have

Size constants

Summary

The size, in full tiles, that this furniture should take up

Categories property

Summary

The categories of this action type. The categories are strings at the start of this action type's Name delimited with a slash (/) character. This property automatically returns a substring of Name, converted to an array.

NameWithoutCategory property

Summary

The Name of this action type, but without a possible category prefix. This property automatically returns a substring of Name.

GetDataKeys() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetData``1() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

SetData() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetDataKeys() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetData``1() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

SetData() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

UnderlyingAction type

Namespace

TinyLife.Actions

Summary

An UnderlyingAction is a class that can instantiate a single Action that will be executed as part of the action it is used in. Note that, when using this class, Update and Validate have to be called in the appropriate places.

Action property

Summary

The underlying action. This should be initialized using Initialize.

Initialize(type,info) method

Summary

Initializes the underlying action of this action

Parameters
Name Type Description
type TinyLife.Actions.ActionType The type of action to initialize
info TinyLife.Actions.ActionInfo The info to pass to the action

Update(time,passedInGame,speed) method

Summary

Updates the Action, if it exists. This action should be called in Update.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current game time
passedInGame System.TimeSpan The amount of time that has passed, in game time
speed TinyLife.GameSpeed The game's current speed setting

Validate(person) method

Summary

Validates this action container and its Action. This method should be called in Validate.

Returns
Parameters
Name Type Description
person TinyLife.Objects.Person

UpdateEvent`1 type

Namespace

TinyLife.Mods.Events

Summary

A delegate used by events that are invoked when something is updated

Parameters
Name Type Description
obj T:TinyLife.Mods.Events.UpdateEvent`1 The object being updated
Generic Types
Name Description
T The type of object that the event is being invoked for

WalkAction type

Namespace

TinyLife.Actions

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

FindPath() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetSpeed() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Wall type

Namespace

TinyLife.World

Summary

A wall is an element of a Map that stops traversal and that has a Wallpaper and optionally an Opening attached to it.

#ctor(positions) constructor

Summary

Creates a new wall at the given position, with the implicitly given verticality

Parameters
Name Type Description
positions Microsoft.Xna.Framework.Point[] The positions that the wall should be placed between

DisplayModes constants

Summary

All defined values of the WallMode enumeration

Positions constants

Summary

The two positions that this wall is placed in. The two positions refer to the tile coordinate of the tile on the front face of the wall, and the tile coordinate of the tile on the back face of the wall.

Price constants

Summary

The price of building a single wall element

Wallpapers constants

Summary

The two wallpapers attached to this Wall, on either one of its sides

Opening property

Summary

The Opening attached to this wall, or null if there is none. Use SetOpening to set this value.

Vertical property

Summary

Stores whether this wall is vertical. A vertical wall is one where the Positions have the same y, but different x coordinates.

Draw(map,time,batch,drawPos) method

Summary

Draws this wall in the world, along with its Wallpapers and Opening

Parameters
Name Type Description
map TinyLife.World.Map The map to draw this wall on
time Microsoft.Xna.Framework.GameTime The game time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch to draw with
drawPos Microsoft.Xna.Framework.Vector2 The position to draw the wall at, in draw space

GetDepth(map,offset) method

Summary

Returns the depth that should be used for a wall placed at this wall's positions. This method is used for rendering Wallpaper and Opening.

Returns
Parameters
Name Type Description
map TinyLife.World.Map The map that this wall is on
offset System.Single An offset that will be added to the depth calculation

GetDisplayMode() method

Summary

Returns the WallMode that this wall should be rendered with. If the Opening is nonnull, its WallMode is returned.

Returns

The wall mode

Parameters

This method has no parameters.

GetIndexForCamera() method

Summary

Returns the side of the wall that should be rendered. For Vertical walls, the position with the highest X value is returned. For non-Vertical walls, the position with the highest Y value is returned.

Returns

The side of the wall that should be rendered

Parameters

This method has no parameters.

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

IsDown() method

Summary

Returns whether this wall should be rendered with a lower height than its actual height. If this value returns true, Draw only draws the first 5 or so pixels of the wall to allow for a simple view of what is behind the wall. This value is based on the lot visibility, the WallMode and more.

Returns

Whether the wall should be rendered down

Parameters

This method has no parameters.

SetOpening(map,opening) method

Summary

Changes the Opening in this wall to the specified one

Parameters
Name Type Description
map TinyLife.World.Map The map that this wall is on
opening TinyLife.World.Opening The opening to set, or null to remove the current one

Validate() method

Summary

This method is called when this object is loaded from disk.

Returns

false if the object is not valid, true otherwise

Parameters

This method has no parameters.

WallDisplay type

Namespace

TinyLife

Summary

The possible modes that a Wall and Roof can display in. The ordering of this enumeration is based on how much of the walls (and roofs) can be seen.

Auto constants

Summary

A wall display that represents the back walls of buildings being Up, but the front wals being Down

Down constants

Summary

A wall display that represents only the lowest few pixels of each wall being displayed

Roofs constants

Summary

A wall display that represents full walls and the roofs of buildings being displayed

Up constants

Summary

A wall display that represents full walls, but no roofs, being displayed

WallMode type

Namespace

TinyLife.World

Summary

This enumeration defines the possible rendering types for Wallpaper. By default, Full is rendered, but an Opening can change the type to allow for windows, doors etc.

Door constants

Summary

A wall mode that represents a wall with a door-shaped hole in it

Full constants

Summary

A wall mode that represents a wall that is rendered in full, without any holes in it

Roof constants

Summary

A wall mode that represents a wall used on the faces of a Roof that are straight

RoofGable constants

Summary

A wall mode that represents a wall used on the faces of a Roof that are gabled

RoofGableInverse constants

Summary

A wall mode that represents a wall used on the faces of a Roof that are gabled in the opposite direction as RoofGable

SmallWindow constants

Summary

A wall mode that represents a wall with a small, rectanglular window in it

WallTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetMouseCursor() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Wallpaper type

Namespace

TinyLife.World

Summary

A wallpaper is a single-instanced object that can be attached to a Wall, which makes the wall render a different texture. To register custom wallpapers, use Register. Note that registered wallpapers need to use a texture generated by ApplyWallpaperMasks.

BaseName constants

Summary

The name of this type of wallpaper. Whereas Name has the index of its color appended to it, this one is just the type's name.

ColorScheme constants

Summary

The ColorScheme that this wallpaper type uses

Icon constants

Summary

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.

Name constants

Summary

The name of this specific wallpaper. This is comprised of the BaseName with the color's index attached to it.

Price constants

Summary

The price of this wallpaper. Can be retrieved easily using GetPrice.

Wallpapers constants

Summary

The registry for all Wallpaper objects in the game and mods. Use Register to register custom wallpapers.

Draw(time,batch,drawPos,mode,isDown,vertical,scale,depth,shadow) method

Summary

Draws this wallpaper on the given wall with the given data.

Parameters
Name Type Description
time Microsoft.Xna.Framework.GameTime The current game time
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The sprite batch used for rendering
drawPos Microsoft.Xna.Framework.Vector2 The position, in screen coordinates, that the wall should be drawn at
mode TinyLife.World.WallMode The WallMode that the wall should be drawn with
isDown System.Boolean Whether or not the wall is rendering with a reduced height
vertical System.Boolean Whether or not the wall is vertical (or horizontal) in the world
scale System.Single The scale that the wall should be rendered with
depth System.Single The depth that the wall should be rendered with
shadow System.Boolean Whether or not the shadow texture should be applied on top of the texture

DrawUi(e,batch,time,drawScale) method

Summary

Draws this wallpaper on the given Element in ui space

Parameters
Name Type Description
e MLEM.Ui.Elements.Element The element to draw on
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The batch to draw with
time Microsoft.Xna.Framework.GameTime The current game time
drawScale System.Single The scale to draw with. Defaults to 0.3.

GetPrice() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Register(name,price,texture,textureRegion,colors,icon) method

Summary

Creates and registers a new wallpaper with the given settings. Note that the texture should be one generated using ApplyWallpaperMasks, as otherwise, graphical issues will occur.

Parameters
Name Type Description
name System.String The name of the wallpaper type
price System.Int32 The price of a single wallpaper of this type
texture MLEM.Textures.UniformTextureAtlas The texture that this wallpaper should use. This needs to have been generated using ApplyWallpaperMasks.
textureRegion Microsoft.Xna.Framework.Point The top left texture region of this wallpaper (on the original texture, not the mask)
colors TinyLife.Utilities.ColorScheme The color scheme of the wallpaper
icon MLEM.Textures.TextureRegion The build mode category icon of this object

WallpaperTool type

Namespace

TinyLife.Tools

Summary

Inherit from parent.

#ctor() constructor

Summary

Inherit from parent.

Parameters

This constructor has no parameters.

Draw() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

GetMouseCursor() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

InitBuildModeUi() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

ShouldHighlightSelectedObject() method

Summary

Inherit from parent.

Parameters

This method has no parameters.

Update() method

Summary

Inherit from parent.

Parameters

This method has no parameters.