Search Results for

    Show / Hide Table of Contents

    Class Lot

    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.

    Inheritance
    System.Object
    MLEM.Data.Json.JsonTypeSafeGenericDataHolder
    Lot
    Implements
    MLEM.Misc.IGenericDataHolder
    IPricedObject
    Inherited Members
    MLEM.Data.Json.JsonTypeSafeGenericDataHolder.SetData(System.String, System.Object)
    MLEM.Data.Json.JsonTypeSafeGenericDataHolder.GetData<T>(System.String)
    MLEM.Data.Json.JsonTypeSafeGenericDataHolder.GetDataKeys()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: TinyLife.World
    Assembly: Tiny Life.dll
    Syntax
    [DataContract]
    public class Lot : JsonTypeSafeGenericDataHolder, IGenericDataHolder, IPricedObject

    Constructors

    Lot(Map, Rectangle)

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

    Declaration
    public Lot(Map map, Rectangle area)
    Parameters
    Type Name Description
    Map map

    The map

    Rectangle area

    The area

    Fields

    Id

    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.

    Declaration
    [DataMember]
    public readonly Guid Id
    Field Value
    Type Description
    System.Guid

    Name

    The name of this lot, as set by the player in build mode

    Declaration
    [DataMember]
    public string Name
    Field Value
    Type Description
    System.String

    Properties

    Area

    The area in the world that this lot occupies

    Declaration
    [DataMember]
    public Rectangle Area { get; }
    Property Value
    Type Description
    Rectangle

    Household

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

    Declaration
    public Household Household { get; }
    Property Value
    Type Description
    Household

    Type

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

    Declaration
    public LotType Type { get; set; }
    Property Value
    Type Description
    LotType

    Methods

    AreRequirementsMet()

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

    Declaration
    public bool AreRequirementsMet()
    Returns
    Type Description
    System.Boolean

    true if the requirements are met, false otherwise

    CanImport(ExportedLot)

    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.

    Declaration
    public bool CanImport(ExportedLot import)
    Parameters
    Type Name Description
    ExportedLot import

    The lot to import

    Returns
    Type Description
    System.Boolean

    true if the lot can be imported, false otherwise

    Export()

    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.

    Declaration
    public ExportedLot Export()
    Returns
    Type Description
    ExportedLot

    An exported version of this lot

    GetCoveredArea()

    Returns a MLEM.Misc.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.

    Declaration
    public RectangleF GetCoveredArea()
    Returns
    Type Description
    MLEM.Misc.RectangleF

    The area that this lot covers

    GetDefaultTile()

    Declaration
    public Tile GetDefaultTile()
    Returns
    Type Description
    Tile

    GetFrontDoor(Vector2)

    Returns this lot's front door, or null if there is no Wall that matches the required conditions. A lot's front door is the door that is closest to the lot's object of interest, which is a RequiredFurniture.

    Declaration
    public (Wall, Vector2) GetFrontDoor(Vector2 position)
    Parameters
    Type Name Description
    Vector2 position

    The position that the front door should be closest to.

    Returns
    Type Description
    System.ValueTuple<Wall, Vector2>

    The lot's front door, or null if there is none.

    GetHomeLocation(Person)

    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.

    Declaration
    public Vector2 GetHomeLocation(Person person)
    Parameters
    Type Name Description
    Person person

    The person whose home location to retrieve

    Returns
    Type Description
    Vector2

    The person's home location on this lot

    GetObjects<T>()

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

    Declaration
    public IEnumerable<T> GetObjects<T>()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    This lot's objects

    Type Parameters
    Name Description
    T

    The type of objects to receive

    GetPrice()

    Returns the price that this object can be bought or sold for. Note that, like in the case of the Painting, the returned price isn't necessarily the full price that the object can be sold for. Instead, the price returned here should be the price that this object has when bought or sold from the FurnitureTool or similar.

    Declaration
    public float GetPrice()
    Returns
    Type Description
    System.Single

    The object's price

    GetRoofs()

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

    Declaration
    public IEnumerable<Roof> GetRoofs()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<Roof>

    GetWalls()

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

    Declaration
    public IEnumerable<Wall> GetWalls()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<Wall>

    This lot's walls

    GetWeeklyBills()

    Returns the amount of tiny bucks that need to be paid weekly by a Household living on this lot. The bills result from the ElectricityRating and WaterRating of the objects on the lot.

    Declaration
    public float GetWeeklyBills()
    Returns
    Type Description
    System.Single

    The amount of weekly bills, in tiny bucks

    Import(ExportedLot, Boolean, Boolean)

    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.

    Declaration
    public void Import(ExportedLot lot, bool exact = false, bool forceClear = false)
    Parameters
    Type Name Description
    ExportedLot lot
    System.Boolean exact

    Whether an exact copy of the lot should be imported. If this is false, the imported lot is moved to best fit the lot's dimensions

    System.Boolean forceClear

    Whether the lot should be force-cleared before importing, meaning even NonSellable objects will be removed

    Validate(Map)

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

    Declaration
    public void Validate(Map map)
    Parameters
    Type Name Description
    Map map

    Implements

    MLEM.Misc.IGenericDataHolder
    IPricedObject

    Extension Methods

    Extensions.JsonCopy<T>(T)
    ☀
    ☾
    In This Article
    Back to top
    © 2021-2022 Ellpeck – Impressum – Privacy – Status
    ☀
    ☾