Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TraderJoe

The trade network controls resource acquisition and disposal on the player market.

Hierarchy

  • TraderJoe

Implements

  • ITradeNetwork

Index

Constructors

constructor

Properties

memory

memory: TraderMemory

Private notifications

notifications: string[]

stats

stats: TraderStats

Methods

Private buildMarketCache

  • buildMarketCache(verbose?: boolean): void

buy

  • buy(terminal: StructureTerminal, resource: ResourceConstant, amount: number): void

Private cleanUpInactiveOrders

  • cleanUpInactiveOrders(): void

Private effectiveBuyPrice

  • effectiveBuyPrice(order: Order, terminal: StructureTerminal): number

Private effectivePrice

  • effectivePrice(order: Order, terminal: StructureTerminal): number
  • Cost per unit including transfer price with energy converted to credits

    Parameters

    • order: Order
    • terminal: StructureTerminal

    Returns number

init

  • init(): void

Private invalidateMarketCache

  • invalidateMarketCache(): void

Private logTransaction

  • logTransaction(order: Order, terminalRoomName: string, amount: number, response: number): void

lookForGoodDeals

  • lookForGoodDeals(terminal: StructureTerminal, resource: ResourceConstant, margin?: number): void
  • Parameters

    • terminal: StructureTerminal
    • resource: ResourceConstant
    • Default value margin: number = 1.25

    Returns void

Private maintainSellOrder

  • maintainSellOrder(terminal: StructureTerminal, resource: ResourceConstant, amount?: number): void
  • Parameters

    • terminal: StructureTerminal
    • resource: ResourceConstant
    • Default value amount: number = 10000

    Returns void

Private notify

  • notify(msg: string): void

priceOf

  • priceOf(mineralType: ResourceConstant): number

Private recordStats

  • recordStats(): void

refresh

  • refresh(): void

run

  • run(): void

sell

  • sell(terminal: StructureTerminal, resource: ResourceConstant, amount?: number): number | undefined
  • Parameters

    • terminal: StructureTerminal
    • resource: ResourceConstant
    • Default value amount: number = 10000

    Returns number | undefined

sellDirectly

  • sellDirectly(terminal: StructureTerminal, resource: ResourceConstant, amount?: number, flexibleAmount?: boolean): number | undefined
  • Parameters

    • terminal: StructureTerminal
    • resource: ResourceConstant
    • Default value amount: number = 1000
    • Default value flexibleAmount: boolean = true

    Returns number | undefined

Object literals

Static settings

settings: object

cache

cache: object

timeout

timeout: number = 25

market

market: object

boostCredits

boostCredits: number = 15000

reserveCredits

reserveCredits: number = 10000

orders

orders: object

cleanupAmount

cleanupAmount: number = 10

timeout

timeout: number = 100000

Generated using TypeDoc