Using Delegates to simulate connected objects
问题 I'm writing an application where I need to simulate the distribution of a resource such as electricity or gas among a large network of objects connected to each other in arbitrary ways. No physics need to be simulated. Just the flow of the units of resources when objects ask for them. Consider the below diagram: ObjA <---> ObjB <---> PwrA <---> ObjF /\ ObjG ObjE<---/ \---> PwrB The Pwr objects can provide resource electricity when asked by the Obj objects. What I need to simulate here is that