// Transfer resources depending on ProviderType relationships private void redock() { foreach (ResourceType resourceType in ((ResourceType[])Enum.GetValues(typeof(ResourceType)))) { IProviderContainer lilGuyContainer = (IProviderContainer)lilGuyCargoHold.getContainer(resourceType); IProviderContainer mothershipContainer = (IProviderContainer)mothershipCargoHold.getContainer(resourceType); transfer(lilGuyContainer, mothershipContainer); } }
/* * User Functions */ // Note: Will collect a resource if any bit of that resource can fit in the container public bool collect(ICollectible collectible) { IContainer container = cargoHold.getContainer(collectible.getType()); if (container.isFull()) { return(false); } container.add(collectible.getAmount()); return(true); }