Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MinerSystem

Makes miner gain resources and draws connections towards the resources

Hierarchy

Index

Constructors

constructor

Methods

draw

  • draw(params: any): void
  • Parameters

    • params: any

    Returns void

drawConnection

  • drawConnection(parameters: any, entity: any, startPos: any, destPos: any, isStreetBelow: any): void
  • Draws the connection to the resource

    Parameters

    • parameters: any
    • entity: any
    • startPos: any
    • destPos: any
    • isStreetBelow: any

    Returns void

drawTransporters

  • drawTransporters(parameters: any, entity: any, startPos: any, destPos: any, isStreetBelow: any): void
  • Draw resource transporters, e.g. minecarts or wood trucks

    Parameters

    • parameters: any
    • entity: any
    • startPos: any
    • destPos: any
    • isStreetBelow: any

    Returns void

initMiner

  • initMiner(entity: any): void
  • Initializes the miner by finding an appropriate source of resources for him

    Parameters

    • entity: any

    Returns void

internalCheckEntityShouldBeInTargetList

  • internalCheckEntityShouldBeInTargetList(entity: any): any

internalPopEntityIfMatching

  • internalPopEntityIfMatching(entity: any): void

internalPostLoadHook

  • internalPostLoadHook(): void

internalPushEntityIfMatching

  • internalPushEntityIfMatching(entity: any): void

internalRecomputeIfTransporterChanged

  • internalRecomputeIfTransporterChanged(building: any): void

internalRecomputeTargetEntities

  • internalRecomputeTargetEntities(): void

internalReconsiderEntityToAdd

  • internalReconsiderEntityToAdd(entity: any): void

internalRegisterEntity

  • internalRegisterEntity(entity: any): void

onStructureDestroyed

  • onStructureDestroyed(entity: any): void
  • Parameters

    • entity: any

    Returns void

onStructurePlaced

  • onStructurePlaced(entity: any): void
  • Parameters

    • entity: any

    Returns void

startDraw

  • startDraw(parameters: any): void
  • see

    GameSystem.draw Wrapper arround the draw method

    Parameters

    • parameters: any

    Returns void

transportCurve

  • transportCurve(currentTime: any, stayTime: any, transportTime: any): (number | false | true)[]
  • Simulates a transport curve:

         _____
        /     \
       /       \

    _/ \

    stayTime controls length of the plateaus transportTime controls slope of the ups / downs

    This is used for the animation of the miners transporters (minecart, truck, etc.). They stay a bit, drive to the resource, stay to collect resources and then return back

    The return is a tuple containing 1. the position on the Y axis and 2. the orientation (=slope) of the curve, which can be used to rotate the sprite depending on the direction

    Parameters

    • currentTime: any
    • stayTime: any
    • transportTime: any

    Returns (number | false | true)[]

update

  • update(): void
  • Returns void