-
Notifications
You must be signed in to change notification settings - Fork 1
Container
Containers are ExperimentObjects which hold chemicals. They have a contents field, which holds the chemicals. Currently the contents is treated as a single Chemical, but in the future, should be able to hold a list of separate Chemicals, for example, oil and water.
Containers have capacity, the maximum amount of Chemicals which can be held by the container.
Containers have residue, which is a field that describes the percentage of the Container's capacity which cannot be removed by normal means. Essentially, when a Container pours its contents, a small amount will be left behind.
pourInto
Take a ContainerController, and pour the contents of the called Controller's container into the parameter Controller's container. For example, if A contains X and B contains Y, and A.pourInto(B) is called, A will be empty, and B will contain a combined version of X and Y. If not all of the Chemicals in A can fit into B, then as much as can fit will be poured. This method will leave residue.
pourOut
Pour out all of the contents of the Container, leaving residue. The poured out Chemical is returned.
addTo Add a given Chemical into the Container. If the given Chemical cannot fit or cannot otherwise be added, this method does nothing.
emptyOut
Removes all contents from the Container, leaving no residue. Also returns removed contents.