Struct ParentInfo
A parent info is a set of information used by DrawColumns(Map, Vector2, float, object, Vector2, TextureRegion, Color, float, Point, List<Item>, bool, ParentInfo, float, SpriteEffects, bool) that allows for objects to be made to look like they're attached to another object. Currently, ParentInfo supports Furniture, Wall and Roof parents.
public readonly struct ParentInfo
- Inherited Members
- Extension Methods
Constructors
ParentInfo(Furniture, AbstractSpot)
Creates a new parent info from the given parent.
public ParentInfo(Furniture furniture, AbstractSpot spot)
Parameters
furniture
FurnitureThe furniture to be attached to.
spot
AbstractSpotThe spot to be attached to.
ParentInfo(AttachmentType)
Creates a new parent info from the given ParentInfo.AttachmentType. This constructor can only be used for attachment types that don't require additional objects. Use the other constructors for those instead.
public ParentInfo(ParentInfo.AttachmentType type)
Parameters
type
ParentInfo.AttachmentTypeThe attachment type.
Exceptions
- ArgumentException
If the given
type
requires additional arguments and a different constructor should be used.
ParentInfo(Person)
Creates a new parent info from the given parent.
public ParentInfo(Person holdingPerson)
Parameters
holdingPerson
PersonThe person to be attached to.
ParentInfo(Roof)
Creates a new parent info from the given parent.
public ParentInfo(Roof roof)
Parameters
roof
RoofThe roof to be attached to.
ParentInfo(Stairs)
Creates a new parent info from the given parent.
public ParentInfo(Stairs stairs)
Parameters
stairs
StairsThe stairs to be attached to.
ParentInfo(Wall)
Creates a new parent info from the given parent.
public ParentInfo(Wall wall)
Parameters
wall
WallThe wall to be attached to.
Fields
Type
The ParentInfo.AttachmentType that this parent info exhibits, based on the constructor that was used to construct it.
public readonly ParentInfo.AttachmentType Type
Field Value
Properties
LayerDepth
Returns the layer depth that objects with this parent info should be displayed with. This results in objects in shelves and on tables being "squished" in terms of depth calculations so that higher shelf levels don't intersect.
public float LayerDepth { get; }
Property Value
ShouldDraw
Whether the object with this parent info should be drawn. This value is determined by the Person that is holding the object.
public bool ShouldDraw { get; }
Property Value
Methods
GetDepthOffset(Vector2)
Returns the depth offset for an object that has this ParentInfo.
public float GetDepthOffset(Vector2 position)
Parameters
position
Vector2The object's position, which should be the same as the depth position passed to DrawColumns(Map, Vector2, float, object, Vector2, TextureRegion, Color, float, Point, List<Item>, bool, ParentInfo, float, SpriteEffects, bool).
Returns
- float
The depth offset.
GetDrawOffset(Vector2)
Returns the draw offset for an object that has this ParentInfo.
public Vector2 GetDrawOffset(Vector2 position)
Parameters
position
Vector2The object's position, which should be the same as the depth position passed to DrawColumns(Map, Vector2, float, object, Vector2, TextureRegion, Color, float, Point, List<Item>, bool, ParentInfo, float, SpriteEffects, bool).
Returns
- Vector2
The draw offset.