Class LinkComponent
This component manages connections to other world objects within a given radius
Inheritance
System.Object
LinkComponent
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public class LinkComponent : WorldObjectComponent, ILinkable, IOwned, IController, IViewController, IHasUniversalID, IHasSerializableID, IRPCAuthChecks, INotifyPropertyChanged, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasInteractions
Constructors
LinkComponent()
Declaration
LinkComponent(Single)
Declaration
public LinkComponent(float connectRadius)
Parameters
| Type |
Name |
Description |
| System.Single |
connectRadius |
|
Fields
MaxConnectRadius
Declaration
public static float MaxConnectRadius
Field Value
| Type |
Description |
| System.Single |
|
Properties
AutoLink
Declaration
public bool AutoLink { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Availability
Declaration
public override WorldObjectComponentClientAvailability Availability { get; }
Property Value
Overrides
BaseConnectionRadius
Radius measurement used to connect to other objects as defined in the object's definition.
Declaration
public float BaseConnectionRadius { get; }
Property Value
| Type |
Description |
| System.Single |
|
ConnectionRadiusModifier
Declaration
public static float ConnectionRadiusModifier { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
DefaultConnectionRadius
Declaration
public static float DefaultConnectionRadius { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
Hidden
Declaration
public bool Hidden { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
IconName
Declaration
public override string IconName { get; }
Property Value
| Type |
Description |
| System.String |
|
Overrides
LinkedInventoryChangeEvent
Declaration
public ThreadSafeAction LinkedInventoryChangeEvent { get; }
Property Value
LinkedObjects
Declaration
public ConcurrentHashSet<LinkComponent> LinkedObjects { get; }
Property Value
| Type |
Description |
| ConcurrentCollections.ConcurrentHashSet<LinkComponent> |
|
ObjectConnectionRadius
Radius measurement used to connect to other objects with applied modifiers. Based on the BaseConnectionRadius.
Declaration
public float ObjectConnectionRadius { get; }
Property Value
| Type |
Description |
| System.Single |
|
OnDelinked
Declaration
public ThreadSafeAction<StorageComponent> OnDelinked { get; }
Property Value
OnInventoryContentsChanged
Declaration
public ThreadSafeAction OnInventoryContentsChanged { get; }
Property Value
OnLinked
Declaration
public ThreadSafeAction<StorageComponent> OnLinked { get; }
Property Value
Methods
ConsolidateLinkedInventory(User)
Declaration
public void ConsolidateLinkedInventory(User user)
Parameters
| Type |
Name |
Description |
| User |
user |
|
Destroy()
Declaration
public override void Destroy()
Overrides
GetAllLinkedStacks(IAlias, Boolean, Boolean)
Declaration
public IEnumerable<ItemStack> GetAllLinkedStacks(IAlias alias, bool source, bool target)
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
| System.Boolean |
source |
|
| System.Boolean |
target |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<ItemStack> |
|
GetAuthorizedLinkedObjects(IAlias)
Declaration
public IEnumerable<LinkComponent> GetAuthorizedLinkedObjects(IAlias alias)
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<LinkComponent> |
|
GetEnabledLinkedStorages(IAlias)
Declaration
public IEnumerable<StorageComponent> GetEnabledLinkedStorages(IAlias alias)
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
Returns
GetLinkedStorages<T>(IAlias)
Declaration
public List<StorageComponent> GetLinkedStorages<T>(IAlias alias)
where T : WorldObjectComponent
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
Returns
Type Parameters
GetLinkedStoragesWithSettings(IAlias)
Declaration
public IEnumerable<(StorageComponent, LinkComponent.LinkSettings)> GetLinkedStoragesWithSettings(IAlias alias)
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
Returns
GetLinkSettings(IAlias, StorageComponent)
Declaration
public LinkComponent.LinkSettings GetLinkSettings(IAlias alias, StorageComponent comp)
Parameters
Returns
GetLinkSettings(IAlias, WorldObject, Type)
Declaration
public LinkComponent.LinkSettings GetLinkSettings(IAlias alias, WorldObject linkedObj, Type compType)
Parameters
Returns
GetSortedLinkedComponents(IAlias, Boolean, Boolean)
Get Sorted linked storages which are able to take/put items. NOTE: will not omit
storages with disabled link settings.
Declaration
public IEnumerable<StorageComponent> GetSortedLinkedComponents(IAlias alias, bool source, bool target)
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
| System.Boolean |
source |
is able to take items
|
| System.Boolean |
target |
is able to put items
|
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerable<StorageComponent> |
list of storages
|
GetSortedLinkedEnabledStorages(IAlias)
Declaration
public IEnumerable<StorageComponent> GetSortedLinkedEnabledStorages(IAlias alias)
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
Returns
GetSortedLinkedInventories(IAlias)
Declaration
public InventoryCollection GetSortedLinkedInventories(IAlias alias)
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
Returns
GetSortedLinkedInventoriesAndUser(Player)
Declaration
public InventoryCollection GetSortedLinkedInventoriesAndUser(Player player)
Parameters
| Type |
Name |
Description |
| Player |
player |
|
Returns
Initialize()
Declaration
public override void Initialize()
Overrides
Initialize(Single)
Declaration
public void Initialize(float connectRadius)
Parameters
| Type |
Name |
Description |
| System.Single |
connectRadius |
|
LinkedComponents(Player)
Declaration
protected Dictionary<StorageComponent, LinkComponent.LinkSettings> LinkedComponents(Player player)
Parameters
| Type |
Name |
Description |
| Player |
player |
|
Returns
LinkSettingsAlias(IAlias)
This alias will be used to get settings instead of provided one.
For demo see how shared link component overrides this value and returns parent's owner.
Declaration
protected virtual IAlias LinkSettingsAlias(IAlias alias)
Parameters
| Type |
Name |
Description |
| IAlias |
alias |
|
Returns
NewDefaultLinkSettings(IAlias, WorldObject, Type)
Declaration
protected virtual LinkComponent.LinkSettings NewDefaultLinkSettings(IAlias alias, WorldObject linkedObj, Type compType)
Parameters
Returns
OnAfterObjectMoved()
Declaration
public override void OnAfterObjectMoved()
Overrides
Relink()
Declaration
protected virtual void Relink()
Declaration
public void SetAllObjectsInput(Player player, bool input)
Parameters
| Type |
Name |
Description |
| Player |
player |
|
| System.Boolean |
input |
|
SetAllObjectsOutput(Player, Boolean)
Declaration
public void SetAllObjectsOutput(Player player, bool output)
Parameters
| Type |
Name |
Description |
| Player |
player |
|
| System.Boolean |
output |
|
SetConnectRadius(Single)
Declaration
public void SetConnectRadius(float value)
Parameters
| Type |
Name |
Description |
| System.Single |
value |
|
SetObjectEnabled(User, StorageComponent, Boolean)
Declaration
public void SetObjectEnabled(User user, StorageComponent comp, bool enable)
Parameters
SetObjectExpanded(Player, StorageComponent, Boolean)
Declaration
protected void SetObjectExpanded(Player player, StorageComponent comp, bool expanded)
Parameters
SetObjectExpanded(User, StorageComponent, Boolean)
Declaration
public void SetObjectExpanded(User user, StorageComponent comp, bool expanded)
Parameters
Declaration
public void SetObjectInput(Player player, StorageComponent comp, bool input)
Parameters
Declaration
public void SetObjectInput(User user, StorageComponent comp, bool input, bool userModified = false)
Parameters
| Type |
Name |
Description |
| User |
user |
|
| StorageComponent |
comp |
|
| System.Boolean |
input |
|
| System.Boolean |
userModified |
|
SetObjectOutput(Player, StorageComponent, Boolean)
Declaration
public void SetObjectOutput(Player player, StorageComponent comp, bool output)
Parameters
SetObjectOutput(User, StorageComponent, Boolean, Boolean)
Declaration
public void SetObjectOutput(User user, StorageComponent comp, bool output, bool userModified = false)
Parameters
| Type |
Name |
Description |
| User |
user |
|
| StorageComponent |
comp |
|
| System.Boolean |
output |
|
| System.Boolean |
userModified |
|
SetObjectPriority(Player, StorageComponent, Int32)
Declaration
protected void SetObjectPriority(Player player, StorageComponent comp, int priority)
Parameters
SetObjectPriority(User, StorageComponent, Int32)
Declaration
public void SetObjectPriority(User user, StorageComponent comp, int priority)
Parameters
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods