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
System.Object
AbstractPlacement
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: ItemChanger.dll
Syntax
public abstract class AbstractPlacement : TaggableObject
Constructors
|
Improve this Doc
View Source
AbstractPlacement(String)
Creates a placement with the given name.
Declaration
public AbstractPlacement(string Name)
Parameters
Type |
Name |
Description |
System.String |
Name |
|
Properties
|
Improve this Doc
View Source
Items
The items attached to the placement.
Declaration
public List<AbstractItem> Items { get; }
Property Value
|
Improve this Doc
View Source
MainContainerType
The container type that best describes the placement as a whole.
Declaration
public virtual string MainContainerType { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Name
The name of the placement. Placement names are enforced to be unique.
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
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
Methods
|
Improve this Doc
View Source
Add(IEnumerable<AbstractItem>)
Adds a range of items to the item list.
Declaration
public AbstractPlacement Add(IEnumerable<AbstractItem> items)
Parameters
Returns
|
Improve this Doc
View Source
Add(AbstractItem)
Adds an item to the item list.
Declaration
public virtual AbstractPlacement Add(AbstractItem item)
Parameters
Returns
|
Improve this Doc
View Source
Add(AbstractItem[])
Adds a range of items to the item list.
Declaration
public AbstractPlacement Add(params AbstractItem[] items)
Parameters
Returns
|
Improve this Doc
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
|
Improve this Doc
View Source
AllObtained()
Returns true when the placement currently has no items to give.
Declaration
public bool AllObtained()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
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
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
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
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public virtual IEnumerable<Tag> GetPlacementAndLocationTags()
Returns
Type |
Description |
IEnumerable<Tag> |
|
|
Improve this Doc
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 |
System.String |
|
|
Improve this Doc
View Source
GetUIName(Int32)
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 |
System.Int32 |
maxLength |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GiveAll(GiveInfo, Nullable<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 |
|
System.Nullable<Action> |
callback |
|
|
Improve this Doc
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
|
Improve this Doc
View Source
OnLoad()
Called by Load(). Dispose hooks in OnUnload.
Declaration
protected abstract void OnLoad()
|
Improve this Doc
View Source
OnObtainedItem(AbstractItem)
Declaration
public virtual void OnObtainedItem(AbstractItem item)
Parameters
|
Improve this Doc
View Source
OnPreview(String)
Declaration
public virtual void OnPreview(string previewText)
Parameters
Type |
Name |
Description |
System.String |
previewText |
|
|
Improve this Doc
View Source
OnUnload()
Declaration
protected abstract void OnUnload()
|
Improve this Doc
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
Events
|
Improve this Doc
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
|
Improve this Doc
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
Extension Methods