Show / Hide Table of Contents

Class BankAccount

Inheritance
System.Object
SimpleEntry
BankAccount
GovernmentBankAccount
PersonalBankAccount
Implements
ILinkableParameterized<System.Boolean>
ILinkableParameterized<SimpleEntry.NamingOptions>
ILinkable
IValidity
ICachesValidity
IHasID
INamed
IReInitializable
IHasReferenceableSerializableID
IHasSerializableID
IDescribable
ISuffixName
IThreadSafeSubscriptions
ISubscriptions<ThreadSafeSubscriptions>
ISubscriptions
IHasDualPermissions
ISettlementAssociated
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged
Inherited Members
SimpleEntry.Description()
SimpleEntry.PostLoad()
SimpleEntry.CreatorText(Player)
SimpleEntry.ToString()
SimpleEntry.SaveInRegistrar()
SimpleEntry.UILinkContent(Boolean)
SimpleEntry.UILinkContent(SimpleEntry.NamingOptions)
SimpleEntry.ReInitialize()
SimpleEntry.MarkDirty()
SimpleEntry.UserDescription
SimpleEntry.Name
SimpleEntry.Creator
SimpleEntry.NameSuffix
SimpleEntry.CreationTime
SimpleEntry.CachedValidity
SimpleEntry.IsDestroyed
SimpleEntry.OnValidityChanged
SimpleEntry.Initialized
SimpleEntry.MarkedUpName
SimpleEntry.Id
SimpleEntry.IconName
SimpleEntry.Registrar
SimpleEntry.WorldTimeSinceCreation
SimpleEntry.TextName
SimpleEntry.Scannable
SimpleEntry.Style
SimpleEntry.ControllerID
SimpleEntry.TrueResult
SimpleEntry.Subscriptions
SimpleEntry.PropertyChanged
Namespace: Eco.Gameplay.Economy
Assembly: Eco.Gameplay.dll
Syntax
public class BankAccount : SimpleEntry, ILinkableParameterized<bool>, ILinkableParameterized<SimpleEntry.NamingOptions>, ILinkable, IValidity, ICachesValidity, IHasID, INamed, IReInitializable, IHasReferenceableSerializableID, IHasSerializableID, IDescribable, ISuffixName, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasDualPermissions, ISettlementAssociated, IController, IViewController, IHasUniversalID, INotifyPropertyChanged

Constructors

BankAccount()

Declaration
public BankAccount()

Properties

AccountNameSuffix

Declaration
public string AccountNameSuffix { get; }
Property Value
Type Description
System.String

AccountOwner

Declaration
public virtual User AccountOwner { get; }
Property Value
Type Description
User

AnyManager

Declaration
public virtual User AnyManager { get; }
Property Value
Type Description
User

AnyMoney

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

AnyUser

Declaration
public virtual User AnyUser { get; }
Property Value
Type Description
User

BalanceChanged

Declaration
public ThreadSafeAction<Currency> BalanceChanged { get; }
Property Value
Type Description
ThreadSafeAction<Currency>

CanBeDeleted

Declaration
public override bool CanBeDeleted { get; }
Property Value
Type Description
System.Boolean
Overrides
SimpleEntry.CanBeDeleted

CanBeSelected

Declaration
public virtual bool CanBeSelected { get; }
Property Value
Type Description
System.Boolean

CanHaveNullSettlement

Declaration
protected virtual bool CanHaveNullSettlement { get; }
Property Value
Type Description
System.Boolean

CurrencyHoldings

Declaration
public ControllerDictionary<Currency, CurrencyHolding> CurrencyHoldings { get; }
Property Value
Type Description
ControllerDictionary<Currency, CurrencyHolding>

CurrencyHoldingsChangedEvent

Declaration
public static ThreadSafeAction<BankAccount> CurrencyHoldingsChangedEvent { get; }
Property Value
Type Description
ThreadSafeAction<BankAccount>

DualPermissions

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

Empty

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

HostChangeEvent

Declaration
public static ThreadSafeAction<BankAccount> HostChangeEvent { get; }
Property Value
Type Description
ThreadSafeAction<BankAccount>

IgnoreDirectTransferTax

Declaration
public virtual bool IgnoreDirectTransferTax { get; }
Property Value
Type Description
System.Boolean

IsActive

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

IsPermanent

Declaration
public virtual bool IsPermanent { get; }
Property Value
Type Description
System.Boolean

Ledger

Declaration
public AccountLedger Ledger { get; }
Property Value
Type Description
AccountLedger

ManagerSetChangedEvent

Declaration
public static ThreadSafeAction<BankAccount, IEnumerable<User>> ManagerSetChangedEvent { get; set; }
Property Value
Type Description
ThreadSafeAction<BankAccount, System.Collections.Generic.IEnumerable<User>>

PermissionsChangedEvent

Declaration
public static ThreadSafeAction<BankAccount> PermissionsChangedEvent { get; }
Property Value
Type Description
ThreadSafeAction<BankAccount>

RenamedEvent

Declaration
public static ThreadSafeAction<BankAccount> RenamedEvent { get; }
Property Value
Type Description
ThreadSafeAction<BankAccount>

ScanPeriodically

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

Settlement

Declaration
public virtual Settlement Settlement { get; set; }
Property Value
Type Description
Settlement

UserSetChangedEvent

Declaration
public static ThreadSafeAction<BankAccount, IEnumerable<User>> UserSetChangedEvent { get; set; }
Property Value
Type Description
ThreadSafeAction<BankAccount, System.Collections.Generic.IEnumerable<User>>

Methods

AddCurrency(Currency, Single, Boolean)

Adds amount of currency to this account. Will fallback to zero if holdings become negative (set assertNegativeAmount if that was intended, otherwise an error will be logged).

Declaration
public void AddCurrency(Currency currency, float amount, bool assertNegativeAmount = true)
Parameters
Type Name Description
Currency currency
System.Single amount
System.Boolean assertNegativeAmount

CanAccess(IAlias, AccountAccess, Boolean)

Check if IAlias has an access to use this account.///

Declaration
public virtual bool CanAccess(IAlias alias, AccountAccess access, bool sendNoticeOnFail = false)
Parameters
Type Name Description
IAlias alias
AccountAccess access
System.Boolean sendNoticeOnFail
Returns
Type Description
System.Boolean

CanAnyAccess(IAlias, AccountAccess, Boolean)

Check if IAlias or any user of this IAlias can use this account.

Declaration
public bool CanAnyAccess(IAlias alias, AccountAccess access, bool sendNoticeOnFail = false)
Parameters
Type Name Description
IAlias alias
AccountAccess access
System.Boolean sendNoticeOnFail
Returns
Type Description
System.Boolean

DescribeHoldings()

Returns an entitled text block with this account's holdings.

Declaration
public LocString DescribeHoldings()
Returns
Type Description
LocString

DescribeWealth(User)

Returns a string with user's percent ownership of this account.

Declaration
public virtual LocString DescribeWealth(User user)
Parameters
Type Name Description
User user
Returns
Type Description
LocString

Destroyed()

Declaration
public override void Destroyed()
Overrides
SimpleEntry.Destroyed()

DisplayAmount(Currency)

Returns string with description of currency amount on this account.

Declaration
public string DisplayAmount(Currency cur)
Parameters
Type Name Description
Currency cur
Returns
Type Description
System.String

GetCurrencyHoldingVal(Currency)

Return total amount of a currency for this account.

Declaration
public float GetCurrencyHoldingVal(Currency cur)
Parameters
Type Name Description
Currency cur
Returns
Type Description
System.Single

GetCurrencyHoldingVal(Currency, User)

Returns amount of a currency for this account owned by a user by percent ownership.

Declaration
public float GetCurrencyHoldingVal(Currency cur, User user)
Parameters
Type Name Description
Currency cur
User user
Returns
Type Description
System.Single

GetResponsibleUser(Boolean)

Returns first found manager of the account

Declaration
public virtual User GetResponsibleUser(bool excludeGovCases = true)
Parameters
Type Name Description
System.Boolean excludeGovCases
Returns
Type Description
User

Initialize()

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

MoveAllCurrencies(BankAccount, LocString, Single)

Move all currencies, without law detection (for destruction of settlements primarily).

Declaration
public void MoveAllCurrencies(BankAccount targetAccount, LocString desc, float percent = 1F)
Parameters
Type Name Description
BankAccount targetAccount
LocString desc
System.Single percent

OnLinkClicked(TooltipOrigin, TooltipClickContext, User)

Declaration
public override void OnLinkClicked(TooltipOrigin origin, TooltipClickContext clickContext, User user)
Parameters
Type Name Description
TooltipOrigin origin
TooltipClickContext clickContext
User user
Overrides
SimpleEntry.OnLinkClicked(TooltipOrigin, TooltipClickContext, User)

PercentOwnership(User)

Returns user's percent ownership of this account for wealth calculation purposes.

Declaration
public virtual float PercentOwnership(User user)
Parameters
Type Name Description
User user
Returns
Type Description
System.Single

RemoveCurrency(Currency)

Reduces holdings to zero (by removing an infinite amount).

Declaration
public void RemoveCurrency(Currency currency)
Parameters
Type Name Description
Currency currency

SetAccountName(Player, String)

Change an account name, will be validated at the same time.

Declaration
public void SetAccountName(Player player, string newName)
Parameters
Type Name Description
Player player
System.String newName

TryAddManagerOrUser(Player, IAlias, PermissionsType)

Check if we're able to add a new manager or user.

Declaration
protected virtual bool TryAddManagerOrUser(Player player, IAlias alias, PermissionsType permissionsChangeType)
Parameters
Type Name Description
Player player
IAlias alias
PermissionsType permissionsChangeType
Returns
Type Description
System.Boolean

TryRemoveManagerOrUser(Player, IAlias, PermissionsType)

Check if we're able to remove an old manager or user.

Declaration
protected virtual bool TryRemoveManagerOrUser(Player player, IAlias alias, PermissionsType permissionsChangeType)
Parameters
Type Name Description
Player player
IAlias alias
PermissionsType permissionsChangeType
Returns
Type Description
System.Boolean

UILinkContent()

Declaration
public override LocString UILinkContent()
Returns
Type Description
LocString
Overrides
SimpleEntry.UILinkContent()

Implements

ILinkableParameterized<T>
ILinkableParameterized<T>
ILinkable
IValidity
ICachesValidity
IHasID
INamed
IReInitializable
IHasReferenceableSerializableID
IHasSerializableID
IDescribable
ISuffixName
IThreadSafeSubscriptions
ISubscriptions<TSubscriptionsList>
ISubscriptions
IHasDualPermissions
ISettlementAssociated
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
BankAccountTooltipLibrary.BankAccountTooltip(BankAccount, User)
ILinkableTooltipLibrary.BankAccountLinkClicked(BankAccount)
MiscTooltipLibrary.SimpleEntryTooltip(SimpleEntry, User)
MiscTooltipLibrary.SimpleEntryTitle(SimpleEntry)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾