Show / Hide Table of Contents

Class LinkComponent

This component manages connections to other world objects within a given radius

Inheritance
System.Object
WorldObjectComponent
LinkComponent
MovableLinkComponent
SharedLinkComponent
Implements
ILinkable
IOwned
IController
IViewController
IHasUniversalID
IHasSerializableID
IRPCAuthChecks
System.ComponentModel.INotifyPropertyChanged
IThreadSafeSubscriptions
ISubscriptions<ThreadSafeSubscriptions>
ISubscriptions
IHasInteractions
Inherited Members
WorldObjectComponent.IsRPCAuthorized(IWorldObserver, AccessType, Object[])
WorldObjectComponent.PostInitialize()
WorldObjectComponent.OnCreate()
WorldObjectComponent.Tick()
WorldObjectComponent.LateTick()
WorldObjectComponent.TryPickup(Player, InventoryChangeSet, Inventory, Boolean)
WorldObjectComponent.OnPickup(Player)
WorldObjectComponent.OnBeforeObjectMoved()
WorldObjectComponent.OnLinkClicked(TooltipOrigin, TooltipClickContext, User)
WorldObjectComponent.UILinkContent()
WorldObjectComponent.Parent
WorldObjectComponent.Name
WorldObjectComponent.ForceActiveTab
WorldObjectComponent.ComponentPrefabName
WorldObjectComponent.ComponentTabName
WorldObjectComponent.Enabled
WorldObjectComponent.IsDestroyed
WorldObjectComponent.ShouldRequestEverything
WorldObjectComponent.Owners
WorldObjectComponent.ControllerID
WorldObjectComponent.IOwned.Deed
WorldObjectComponent.Subscriptions
WorldObjectComponent.PropertyChanged
Namespace: Eco.Gameplay.Components
Assembly: Eco.Gameplay.dll
Syntax
public class LinkComponent : WorldObjectComponent, ILinkable, IOwned, IController, IViewController, IHasUniversalID, IHasSerializableID, IRPCAuthChecks, INotifyPropertyChanged, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasInteractions
Remarks

This assumes the world object is stationary

Constructors

LinkComponent()

Declaration
public LinkComponent()

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
Type Description
WorldObjectComponentClientAvailability
Overrides
WorldObjectComponent.Availability

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
WorldObjectComponent.IconName

LinkedInventoryChangeEvent

Declaration
public ThreadSafeAction LinkedInventoryChangeEvent { get; }
Property Value
Type Description
ThreadSafeAction

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
Type Description
ThreadSafeAction<StorageComponent>

OnInventoryContentsChanged

Declaration
public ThreadSafeAction OnInventoryContentsChanged { get; }
Property Value
Type Description
ThreadSafeAction

OnLinked

Declaration
public ThreadSafeAction<StorageComponent> OnLinked { get; }
Property Value
Type Description
ThreadSafeAction<StorageComponent>

Methods

ConsolidateLinkedInventory(User)

Declaration
public void ConsolidateLinkedInventory(User user)
Parameters
Type Name Description
User user

Destroy()

Declaration
public override void Destroy()
Overrides
WorldObjectComponent.Destroy()

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
Type Description
System.Collections.Generic.IEnumerable<StorageComponent>

GetLinkedStorages<T>(IAlias)

Declaration
public List<StorageComponent> GetLinkedStorages<T>(IAlias alias)
    where T : WorldObjectComponent
Parameters
Type Name Description
IAlias alias
Returns
Type Description
System.Collections.Generic.List<StorageComponent>
Type Parameters
Name Description
T

GetLinkedStoragesWithSettings(IAlias)

Declaration
public IEnumerable<(StorageComponent, LinkComponent.LinkSettings)> GetLinkedStoragesWithSettings(IAlias alias)
Parameters
Type Name Description
IAlias alias
Returns
Type Description
System.Collections.Generic.IEnumerable<System.ValueTuple<StorageComponent, LinkComponent.LinkSettings>>

GetLinkSettings(IAlias, StorageComponent)

Declaration
public LinkComponent.LinkSettings GetLinkSettings(IAlias alias, StorageComponent comp)
Parameters
Type Name Description
IAlias alias
StorageComponent comp
Returns
Type Description
LinkComponent.LinkSettings

GetLinkSettings(IAlias, WorldObject, Type)

Declaration
public LinkComponent.LinkSettings GetLinkSettings(IAlias alias, WorldObject linkedObj, Type compType)
Parameters
Type Name Description
IAlias alias
WorldObject linkedObj
System.Type compType
Returns
Type Description
LinkComponent.LinkSettings

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
Type Description
System.Collections.Generic.IEnumerable<StorageComponent>

GetSortedLinkedInventories(IAlias)

Declaration
public InventoryCollection GetSortedLinkedInventories(IAlias alias)
Parameters
Type Name Description
IAlias alias
Returns
Type Description
InventoryCollection

GetSortedLinkedInventoriesAndUser(Player)

Declaration
public InventoryCollection GetSortedLinkedInventoriesAndUser(Player player)
Parameters
Type Name Description
Player player
Returns
Type Description
InventoryCollection

Initialize()

Declaration
public override void Initialize()
Overrides
WorldObjectComponent.Initialize()

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
Type Description
System.Collections.Generic.Dictionary<StorageComponent, LinkComponent.LinkSettings>

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
Type Description
IAlias

NewDefaultLinkSettings(IAlias, WorldObject, Type)

Gets LinkComponent.LinkSettings which langword_csharp_this should use when linking to StorageComponent of type compType attached to linkedObj

Declaration
protected virtual LinkComponent.LinkSettings NewDefaultLinkSettings(IAlias alias, WorldObject linkedObj, Type compType)
Parameters
Type Name Description
IAlias alias
WorldObject linkedObj

WorldObject that langword_csharp_this wants to link to

System.Type compType

System.Type of StorageComponent attached to linkedObj for which LinkComponent.LinkSettings will be returned

Returns
Type Description
LinkComponent.LinkSettings

OnAfterObjectMoved()

Declaration
public override void OnAfterObjectMoved()
Overrides
WorldObjectComponent.OnAfterObjectMoved()

Relink()

Declaration
protected virtual void Relink()

SetAllObjectsInput(Player, Boolean)

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
Type Name Description
User user
StorageComponent comp
System.Boolean enable

SetObjectExpanded(Player, StorageComponent, Boolean)

Declaration
protected void SetObjectExpanded(Player player, StorageComponent comp, bool expanded)
Parameters
Type Name Description
Player player
StorageComponent comp
System.Boolean expanded

SetObjectExpanded(User, StorageComponent, Boolean)

Declaration
public void SetObjectExpanded(User user, StorageComponent comp, bool expanded)
Parameters
Type Name Description
User user
StorageComponent comp
System.Boolean expanded

SetObjectInput(Player, StorageComponent, Boolean)

Declaration
public void SetObjectInput(Player player, StorageComponent comp, bool input)
Parameters
Type Name Description
Player player
StorageComponent comp
System.Boolean input

SetObjectInput(User, StorageComponent, Boolean)

Declaration
public void SetObjectInput(User user, StorageComponent comp, bool input)
Parameters
Type Name Description
User user
StorageComponent comp
System.Boolean input

SetObjectOutput(Player, StorageComponent, Boolean)

Declaration
public void SetObjectOutput(Player player, StorageComponent comp, bool output)
Parameters
Type Name Description
Player player
StorageComponent comp
System.Boolean output

SetObjectOutput(User, StorageComponent, Boolean)

Declaration
public void SetObjectOutput(User user, StorageComponent comp, bool output)
Parameters
Type Name Description
User user
StorageComponent comp
System.Boolean output

SetObjectPriority(Player, StorageComponent, Int32)

Declaration
protected void SetObjectPriority(Player player, StorageComponent comp, int priority)
Parameters
Type Name Description
Player player
StorageComponent comp
System.Int32 priority

SetObjectPriority(User, StorageComponent, Int32)

Declaration
public void SetObjectPriority(User user, StorageComponent comp, int priority)
Parameters
Type Name Description
User user
StorageComponent comp
System.Int32 priority

Implements

ILinkable
IOwned
IController
IViewController
IHasUniversalID
IHasSerializableID
IRPCAuthChecks
System.ComponentModel.INotifyPropertyChanged
IThreadSafeSubscriptions
ISubscriptions<TSubscriptionsList>
ISubscriptions
IHasInteractions

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾