コード例 #1
0
 public virtual void CollectResources(IList <ResourcePtr> ResourceCollector)
 {
     foreach (IHasResources AC in AllComponents.Where(x => x is IHasResources))
     {
         AC.CollectResources(ResourceCollector);
     }
 }
コード例 #2
0
 public List <Lamp> GetAllLamps()
 {
     return(AllComponents.Where(x => x is Lamp).Cast <Lamp>().ToList());
 }
コード例 #3
0
 public List <Switch> GetAllSwitches()
 {
     return(AllComponents.Where(x => x is Switch).Cast <Switch>().ToList());
 }