// // card.cpp // cards-proof // // Created by Ethan Miller on 3/9/12. // #include #include #include "card.h" using namespace std; map card::default_strings; map card::default_ints; bool card::default_card_is_set = false; istream & operator>>( istream & in, card & c ) { return in; } string card::get_string_attribute( string attribute ) { return string_attributes_.find(attribute)->second; } int card::get_numeric_attribute( string attribute ) { std::map::const_iterator itr; itr = numeric_attributes_.find(attribute); return itr->second; } void card::set_default(istream & in) { string token; in >> token; while (token != "enddef" && in) { if (token == "int") { in >> token; default_ints[token] = 0; } else if (token == "string") { in >> token; default_strings[token] = ""; } in >> token; } }