Documentation

MinimumCostFlowCalculator
in package

Calculates the path(s) of least resistance for liquid flow.

Table of Contents

BLOCKED  = -1
CAN_FLOW  = 0
CAN_FLOW_DOWN  = 1
$canFlowInto  : Closure
$flowCostVisited  : array<string|int, mixed>
$flowDecayPerBlock  : int
$world  : World
__construct()  : mixed
getOptimalFlowDirections()  : array<string|int, int>
calculateFlowCost()  : int
canFlowInto()  : bool

Constants

Properties

Methods

__construct()

public __construct(World $world, int $flowDecayPerBlock, Closure $canFlowInto) : mixed
Parameters
$world : World
$flowDecayPerBlock : int
$canFlowInto : Closure
Tags
phpstan-param

\Closure(Block) : bool $canFlowInto

Return values
mixed

getOptimalFlowDirections()

public getOptimalFlowDirections(int $originX, int $originY, int $originZ) : array<string|int, int>
Parameters
$originX : int
$originY : int
$originZ : int
Return values
array<string|int, int>

calculateFlowCost()

private calculateFlowCost(int $blockX, int $blockY, int $blockZ, int $accumulatedCost, int $maxCost, int $originOpposite, int $lastOpposite) : int
Parameters
$blockX : int
$blockY : int
$blockZ : int
$accumulatedCost : int
$maxCost : int
$originOpposite : int
$lastOpposite : int
Return values
int

Search results