diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-03-18 22:09:31 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-03-18 22:09:31 -0700 |
commit | 9cc16d04958753a62474d13bd823f13a33a6a0a3 (patch) | |
tree | 2fc4b37f8fda0d8ac7662cdf5cf05a942b428f45 /cpp/010vm | |
parent | b1299d632715669c90dde918f5522c776b853e66 (diff) | |
download | mu-9cc16d04958753a62474d13bd823f13a33a6a0a3.tar.gz |
956
Cleaner way to signal that a reagent's value has been computed.
Diffstat (limited to 'cpp/010vm')
-rw-r--r-- | cpp/010vm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/010vm b/cpp/010vm index 8bb1604b..d8394fdb 100644 --- a/cpp/010vm +++ b/cpp/010vm @@ -41,6 +41,7 @@ struct reagent { vector<pair<string, vector<string> > > properties; string name; int value; + bool initialized; vector<type_number> types; reagent(string s); reagent(type_number t); @@ -139,7 +140,7 @@ void setup_recipes() { void instruction::clear() { is_label=false; label.clear(); operation=IDLE; ingredients.clear(); products.clear(); } // Reagents have the form <name>:<type>:<type>:.../<property>/<property>/... - reagent::reagent(string s) :value(0) { + reagent::reagent(string s) :value(0), initialized(false) { istringstream in(s); // properties while (!in.eof()) { @@ -156,7 +157,7 @@ void setup_recipes() { types.push_back(Type_number[properties[0].second[i]]); } } - reagent::reagent(type_number t) :value(0) { + reagent::reagent(type_number t) :value(0), initialized(false) { types.push_back(t); } string reagent::to_string() { |