Class LotType
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.
Inheritance
Inherited Members
Namespace: TinyLife.World
Assembly: Tiny Life.dll
Syntax
[JsonConverter(typeof(StaticJsonConverter<LotType>), new object[]{typeof(LotType), "PrivateTypes"})]
public class LotType
Constructors
LotType(String, TextureRegion, Boolean, Func<Lot, Person, Int32>, (Predicate<Furniture>, Int32, String)[])
Creates a new lot type with the given settings
Declaration
public LotType(string name, TextureRegion icon, bool isResidential, Func<Lot, Person, int> getVisitPriority, params (Predicate<Furniture>, int, string)[] requiredFurniture)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of this lot type |
MLEM.Textures.TextureRegion | icon | The icon that this lot type should display. |
System.Boolean | isResidential | Whether lots of this type should be considered residential |
System.Func<Lot, Person, System.Int32> | getVisitPriority | A function that returns this lot type's visitation priority |
System.ValueTuple<System.Predicate<Furniture>, System.Int32, System.String>[] | requiredFurniture | A set of furniture and amounts that have to be present on lots of this type, as well as an unlocalized name for the requirement |
Fields
Cafe
Declaration
public static readonly LotType Cafe
Field Value
Type | Description |
---|---|
LotType |
GenericPublicLot
Declaration
public static readonly LotType GenericPublicLot
Field Value
Type | Description |
---|---|
LotType |
GetVisitPriority
A function that returns, for a Lot with this lot type, and a Person trying ot visit the lot, how likely it is for the lot to be chosen. The higher the return value is, the more likely it is for this lot to be chosen. For reference, the "Park" lot type always returns 200.
Declaration
public readonly Func<Lot, Person, int> GetVisitPriority
Field Value
Type | Description |
---|---|
System.Func<Lot, Person, System.Int32> |
Gym
Declaration
public static readonly LotType Gym
Field Value
Type | Description |
---|---|
LotType |
Icon
The icon that this lot type should display.
Declaration
public readonly TextureRegion Icon
Field Value
Type | Description |
---|---|
MLEM.Textures.TextureRegion |
IsResidential
Whether this lot is residential. A residential lot is one that Households can move into.
Declaration
public readonly bool IsResidential
Field Value
Type | Description |
---|---|
System.Boolean |
KidsPlayground
Declaration
public static readonly LotType KidsPlayground
Field Value
Type | Description |
---|---|
LotType |
Name
The name of this lot type
Declaration
public readonly string Name
Field Value
Type | Description |
---|---|
System.String |
Park
Declaration
public static readonly LotType Park
Field Value
Type | Description |
---|---|
LotType |
RequiredFurniture
A set of furniture that is required on the lot. Each entry determines the Furniture required, as well as the amount of that item that is required on the lot and an unlocalized display name for the requirement.
Declaration
public readonly (Predicate<Furniture> Predicate, int Amount, string Name)[] RequiredFurniture
Field Value
Type | Description |
---|---|
System.ValueTuple<System.Predicate<Furniture>, System.Int32, System.String>[] |
Residential
Declaration
public static readonly LotType Residential
Field Value
Type | Description |
---|---|
LotType |
Types
A registry for all LotType objects that the game and mods define
Declaration
public static readonly ReadOnlyDictionary<string, LotType> Types
Field Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyDictionary<System.String, LotType> |
Properties
CanExecuteAction
A function that optionally determines whether a certain ActionType can be executed on this lot. This function also receives a ActionInfo, and a langword_csharp_bool that indicates whether the action is started automatically. This function is useful for lots like Cafe, where using a coffee machine is disallowed if the person is not a lot employee.
Declaration
public Func<ActionType, ActionInfo, bool, CanExecuteResult> CanExecuteAction { get; set; }
Property Value
Type | Description |
---|---|
System.Func<ActionType, ActionInfo, System.Boolean, TinyLife.Actions.CanExecuteResult> |
DisplayName
Returns the display name of this lot, which is the Icon followed by a localized version of the Name.
Declaration
public string DisplayName { get; }
Property Value
Type | Description |
---|---|
System.String |
Employments
A set of LotEmployment instances that this lot requires to keep running. Players have the ability to add people from their exported households to work in a lot employment position.
Declaration
public LotEmployment[] Employments { get; set; }
Property Value
Type | Description |
---|---|
LotEmployment[] |
Methods
GetGroupVisitPriority(Lot, Int32)
A helper method intended to be used with GetVisitPriority that increases the passed visit priority if there are already other people on the lot. This method should be used for public lots to increase the likelihood of additional people visiting if the player visits the lot.
Declaration
public static int GetGroupVisitPriority(Lot lot, int basePriority)
Parameters
Type | Name | Description |
---|---|---|
Lot | lot | The lot whose visit priority to query |
System.Int32 | basePriority | The base visit priority that the lot should have if no one is there already |
Returns
Type | Description |
---|---|
System.Int32 | A visit priority affected by the amount of people on the lot |
Register(LotType)
Registers a new lot type to the Types registry
Declaration
public static LotType Register(LotType type)
Parameters
Type | Name | Description |
---|---|---|
LotType | type | The lot type to register |
Returns
Type | Description |
---|---|
LotType |