class Chemystal::MoleculeSoup
- Chemystal::MoleculeSoup
- Reference
- Object
Overview
A Molecule Soup is a Hash from the molecules name to a deque of molecules having that same name
The use of a deque is to have FIFO, such that no old molecules are left floating around in the soup
Defined in:
chemystal/chemical_machine/molecule_soup.crInstance Method Summary
-
#add_molecule(molecule : Molecule)
Adds a molecule to the soup
-
#get_molecules_with_name(name : String) : Deque(Molecule)
Gets all molecules with the name
-
#has_molecule_with_name(name : String) : Bool
Checks if at least one molecule with the name is in the soup
-
#use_molecule_with_name(name : String) : Molecule | Nil
Consumes one molecule withe the name, returning it and removing it from the soup
Instance Method Detail
def has_molecule_with_name(name : String) : Bool
#
Checks if at least one molecule with the name is in the soup