Show / Hide Table of Contents

Class ForSaleComponent

A component that allows purchase + pickup of a world object.

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

Constructors

ForSaleComponent()

Declaration
public ForSaleComponent()

Fields

SellEvents

Declaration
public ThreadSafeList<Func<Result>> SellEvents
Field Value
Type Description
ThreadSafeList<System.Func<Result>>

SoldEvent

Declaration
public ThreadSafeAction<User, Currency, float, LocString> SoldEvent
Field Value
Type Description
ThreadSafeAction<User, Currency, System.Single, LocString>

Properties

Currency

Declaration
public Currency Currency { get; set; }
Property Value
Type Description
Currency

ForSale

Declaration
public bool ForSale { get; set; }
Property Value
Type Description
System.Boolean

PersistentData

Declaration
public object PersistentData { get; set; }
Property Value
Type Description
System.Object

Price

Declaration
public float Price { get; set; }
Property Value
Type Description
System.Single

SaleData

Declaration
public ForSaleData SaleData { get; set; }
Property Value
Type Description
ForSaleData

SalePriceString

Declaration
[EnvVar]
public string SalePriceString { get; }
Property Value
Type Description
System.String

SellersAccount

Declaration
public BankAccount SellersAccount { get; set; }
Property Value
Type Description
BankAccount

Title

Declaration
public LocString Title { get; set; }
Property Value
Type Description
LocString

Methods

Buy(User)

Declaration
public Task Buy(User user)
Parameters
Type Name Description
User user
Returns
Type Description
System.Threading.Tasks.Task

BuyInteraction(Player, InteractionTriggerInfo, InteractionTarget)

Declaration
[Interaction]
public void BuyInteraction(Player player, InteractionTriggerInfo trigger, InteractionTarget target)
Parameters
Type Name Description
Player player
InteractionTriggerInfo trigger
InteractionTarget target

CanBuy(User)

Can only buy it if its for sale, has valid props, and user isnt already an owner (unless force enabled)

Declaration
[EnvVar]
public bool CanBuy(User user)
Parameters
Type Name Description
User user
Returns
Type Description
System.Boolean

Initialize()

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

SetConfig(ForSaleComponent.SaleTypes, Func<LocString>, Func<Item>)

Config how this for-sale component works.

Declaration
public void SetConfig(ForSaleComponent.SaleTypes saleType, Func<LocString> customDescription = null, Func<Item> itemPickedUp = null)
Parameters
Type Name Description
ForSaleComponent.SaleTypes saleType
System.Func<LocString> customDescription
System.Func<Item> itemPickedUp

Implements

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

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
☀
☾