class Chemystal::ReactionCollection
- Chemystal::ReactionCollection
- Reference
- Object
Overview
A Reaction Collection is a Hash from molecule names to an array of reactions having that molecule as part of their requirement
The idea behind this structure is that whenever a new molecule spawns, only the array of reactions requiring the new molecule will be searched for new reactions to occur
Defined in:
chemystal/chemical_machine/reaction_collection.crConstructors
Instance Method Summary
-
#add_reaction(reaction : Reaction)
Adds a reaction to the collection by adding it to all its requirements name entries
-
#find_and_run_reaction(molecule_soup : MoleculeSoup, new_molecule_name : String | Nil)
Runs all reactions on startup, or none or one reaction if responding to a new molecule
Constructor Detail
Instance Method Detail
Adds a reaction to the collection by adding it to all its requirements name entries
def find_and_run_reaction(molecule_soup : MoleculeSoup, new_molecule_name : String | Nil)
#
Runs all reactions on startup, or none or one reaction if responding to a new molecule