@ -14,19 +14,19 @@ using LogicWorld.Server.Circuitry;
namespace CriticalPathAnalyzer.Server.Tool {
public class ServerPathTracer {
// Reflection/Delegate access helpers:
private static readonly Func < InputPeg , Cluster > G etCluster;
private static readonly Func < InputPeg , Cluster > g etCluster;
// Services needed to lookup wires/pegs:
private static readonly ICircuitryManager C ircuits;
private static readonly IWorldData W orld;
private static readonly ICircuitryManager c ircuits;
private static readonly IWorldData w orld;
static ServerPathTracer ( ) {
G etCluster = Delegator . createPropertyGetter < InputPeg , Cluster > (
g etCluster = Delegator . createPropertyGetter < InputPeg , Cluster > (
Properties . getPrivate ( typeof ( InputPeg ) , "Cluster" )
) ;
C ircuits = ServiceGetter . getService < ICircuitryManager > ( ) ;
W orld = ServiceGetter . getService < IWorldData > ( ) ;
c ircuits = ServiceGetter . getService < ICircuitryManager > ( ) ;
w orld = ServiceGetter . getService < IWorldData > ( ) ;
}
public static bool TracePath (
@ -342,7 +342,7 @@ namespace CriticalPathAnalyzer.Server.Tool {
/// <param name="address">Address of the peg</param>
/// <returns>True if it exists, false if it doesn't</returns>
private static bool PegExists ( PegAddress address ) {
IComponentInWorld component = W orld. Lookup ( address . ComponentAddress ) ;
IComponentInWorld component = w orld. Lookup ( address . ComponentAddress ) ;
if ( component = = null ) {
return false ; // Component of the peg does not exist in world.
}
@ -353,13 +353,13 @@ namespace CriticalPathAnalyzer.Server.Tool {
}
private static Cluster GetClusterAt ( InputAddress peg ) {
InputPeg originPeg = C ircuits. LookupInput ( peg ) ;
InputPeg originPeg = c ircuits. LookupInput ( peg ) ;
if ( originPeg = = null ) {
throw new Exception (
"Tried to lookup cluster on input peg, but the peg was not present in the circuit model! This should never happen, as the peg is present in the world." ) ;
}
Cluster cluster = G etCluster( originPeg ) ;
Cluster cluster = g etCluster( originPeg ) ;
if ( cluster = = null ) {
throw new Exception (
"Tried to lookup cluster on input peg, but the cluster was 'null', this should never happen! As the peg is present in the world." ) ;
@ -378,13 +378,13 @@ namespace CriticalPathAnalyzer.Server.Tool {
if ( pegAddress . IsInputAddress ( out InputAddress inputAddress ) ) {
primaryClusters . Add ( GetClusterAt ( inputAddress ) ) ;
} else {
HashSet < WireAddress > wires = W orld. LookupPegWires ( pegAddress ) ;
HashSet < WireAddress > wires = w orld. LookupPegWires ( pegAddress ) ;
if ( wires = = null ) {
return ;
}
foreach ( WireAddress wireAddress in wires ) {
Wire wire = W orld. Lookup ( wireAddress ) ;
Wire wire = w orld. Lookup ( wireAddress ) ;
if ( wire = = null ) {
throw new Exception (
"Tried to lookup wire given its address, but the world did not contain it. World must be corrupted." ) ;