Show / Hide Table of Contents

Class AbstractPlacement

The base class for all placements. Placements carry a list of items and specify how to implement those items, often using locations.

Inheritance
object
TaggableObject
AbstractPlacement
AutoPlacement
CostChestPlacement
DualPlacement
EggShopPlacement
ExistingContainerPlacement
MutablePlacement
ShopPlacement
YNShinyPlacement
Inherited Members
TaggableObject.tags
TaggableObject.LoadTags()
TaggableObject.UnloadTags()
TaggableObject.AddTag<T>()
TaggableObject.AddTag(Tag)
TaggableObject.AddTags(IEnumerable<Tag>)
TaggableObject.GetTag<T>()
TaggableObject.GetTag<T>(out T)
TaggableObject.GetTags<T>()
TaggableObject.GetOrAddTag<T>()
TaggableObject.HasTag<T>()
TaggableObject.RemoveTags<T>()
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: ItemChanger
Assembly: ItemChanger.dll
Syntax
public abstract class AbstractPlacement : TaggableObject

Constructors

View Source

AbstractPlacement(string)

Creates a placement with the given name.

Declaration
public AbstractPlacement(string Name)
Parameters
Type Name Description
string Name

Properties

View Source

Items

The items attached to the placement.

Declaration
public List<AbstractItem> Items { get; }
Property Value
Type Description
List<AbstractItem>
View Source

MainContainerType

The container type that best describes the placement as a whole.

Declaration
public virtual string MainContainerType { get; }
Property Value
Type Description
string
View Source

Name

The name of the placement. Placement names are enforced to be unique.

Declaration
public string Name { get; }
Property Value
Type Description
string
View Source

Visited

An enumeration of visit flags accrued by the placement. Which flags may be set depends on the placement type and other factors.

Declaration
public VisitState Visited { get; }
Property Value
Type Description
VisitState

Methods

View Source

Add(AbstractItem)

Adds an item to the item list.

Declaration
public virtual AbstractPlacement Add(AbstractItem item)
Parameters
Type Name Description
AbstractItem item
Returns
Type Description
AbstractPlacement
View Source

Add(params AbstractItem[])

Adds a range of items to the item list.

Declaration
public AbstractPlacement Add(params AbstractItem[] items)
Parameters
Type Name Description
AbstractItem[] items
Returns
Type Description
AbstractPlacement
View Source

Add(IEnumerable<AbstractItem>)

Adds a range of items to the item list.

Declaration
public AbstractPlacement Add(IEnumerable<AbstractItem> items)
Parameters
Type Name Description
IEnumerable<AbstractItem> items
Returns
Type Description
AbstractPlacement
View Source

AddVisitFlag(VisitState)

Sets the visit state of the placement to the union of its current flags and the parameter flags.

Declaration
public void AddVisitFlag(VisitState flag)
Parameters
Type Name Description
VisitState flag
View Source

AllObtained()

Returns true when the placement currently has no items to give.

Declaration
public bool AllObtained()
Returns
Type Description
bool
View Source

CheckVisitedAll(VisitState)

Returns true if the flags are a subset of the placement's visit state.

Declaration
public bool CheckVisitedAll(VisitState flags)
Parameters
Type Name Description
VisitState flags
Returns
Type Description
bool
View Source

CheckVisitedAny(VisitState)

Returns true if the flags have nonempty intersection with the placement's visit state.

Declaration
public bool CheckVisitedAny(VisitState flags)
Parameters
Type Name Description
VisitState flags
Returns
Type Description
bool
View Source

GetPlacementAndLocationTags()

Declaration
public virtual IEnumerable<Tag> GetPlacementAndLocationTags()
Returns
Type Description
IEnumerable<Tag>
View Source

GetUIName()

Combines and returns the preview names of the unobtained items at the placement. Used for most hints or previews.

Declaration
public string GetUIName()
Returns
Type Description
string
View Source

GetUIName(int)

Combines and returns the preview names of the unobtained items at the placement, trimmed to the specified length.

Declaration
public string GetUIName(int maxLength)
Parameters
Type Name Description
int maxLength
Returns
Type Description
string
View Source

GiveAll(GiveInfo, Action?)

Helper method for giving all of the items of the placement in sequence, so that the UIDef message of one leads into giving the next.

Declaration
public void GiveAll(GiveInfo info, Action? callback = null)
Parameters
Type Name Description
GiveInfo info
Action callback
View Source

Load()

Called on each saved placement when the save is created or resumed.
Execution order is (modules load -> placement tags load -> items load -> placements load)

Declaration
public void Load()
View Source

OnLoad()

Called by Load(). Dispose hooks in OnUnload.

Declaration
protected abstract void OnLoad()
View Source

OnObtainedItem(AbstractItem)

Declaration
public virtual void OnObtainedItem(AbstractItem item)
Parameters
Type Name Description
AbstractItem item
View Source

OnPreview(string)

Declaration
public virtual void OnPreview(string previewText)
Parameters
Type Name Description
string previewText
View Source

OnUnload()

Called by Unload().

Declaration
protected abstract void OnUnload()
View Source

Unload()

Called on each saved placement upon returning to main menu.
Execution order is (modules unload -> placement tags unload -> items unload -> placements unload)

Declaration
public void Unload()

Events

View Source

OnVisitStateChanged

Event invoked by this placement whenever AddVisitFlag is called. Use the NoChange property of the args to detect whether a change will occur.

Declaration
public event Action<VisitStateChangedEventArgs>? OnVisitStateChanged
Event Type
Type Description
Action<VisitStateChangedEventArgs>
View Source

OnVisitStateChangedGlobal

Event invoked by each placement whenever new flags are added to its Visited. Skipped if added flags are a subset of Visited.

Declaration
public static event Action<VisitStateChangedEventArgs>? OnVisitStateChangedGlobal
Event Type
Type Description
Action<VisitStateChangedEventArgs>

Extension Methods

Extensions.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX