public override bool TryFindBlock(SimulationBlock block, ref List <SimulationBlock> blockChain) { if (block == this) { blockChain.Insert(0, this); return(true); } else { return(false); } }
public override bool TryFindBlock(SimulationBlock block, ref List <SimulationBlock> blockChain) { for (int i = 0; i < subBlocks.Count; i++) { if (block == this) { blockChain.Insert(0, this); return(true); } if (subBlocks[i].TryFindBlock(block, ref blockChain)) { blockChain.Insert(0, this); return(true); } } return(false); }
public abstract bool TryFindBlock(SimulationBlock block, ref List <SimulationBlock> blockChain);