private DoubleEdgedPipe GetDoubleEdgedPipe(DoubleEdgedPipe pipe, IConstBlock block) { foreach (var p in block.PipesWithBothEdges) { if (p.IsEqualTo(pipe)) { return(p); } } return(null); }
private List <ConnectingPipe> GetConnectingPipesThatComposeTwoEdgedPipe(DoubleEdgedPipe pipe, IConstBlock block) { var list = new List <ConnectingPipe>(); foreach (var connectingPipe in block.PipesWithOneEdge) { if (connectingPipe.Edge == pipe.FirstEdge || connectingPipe.Edge == pipe.SecondEdge) { list.Add(connectingPipe); } } return(list); }
private bool CheckIfDoubleEdgedPipeCanBeComposedOfTwoConnectingPipes(DoubleEdgedPipe pipe, IConstBlock block) { return(block.PipesWithOneEdge.Select(p => p.Edge).ToList().Any(p => p == pipe.FirstEdge) && block.PipesWithOneEdge.Select(p => p.Edge).ToList().Any(p => p == pipe.SecondEdge)); }
private bool CheckIfConnectingPipeAlreadyExists(ConnectingPipe pipe, IConstBlock block) { return(block.PipesWithOneEdge.Any(p => p.IsEqualTo(pipe))); }
private bool CheckIfDoubleEdgeAlreadyExists(DoubleEdgedPipe pipe, IConstBlock block) { return(block.PipesWithBothEdges.Any(p => p.IsEqualTo(pipe))); }
private DoubleEdgedPipe HasIntersectingPipes(IConstBlock block, DoubleEdgedPipe pipeToCheck) { return(block.PipesWithBothEdges.FirstOrDefault(pipe => DoPipesIntersect(pipe, pipeToCheck))); }
public JetEngine(IConstBlock block, EdgeType facingDirection) { Block = block; FacingDirection = facingDirection; }