21 o <<
"************" << std::endl;
22 o <<
"a_material:" << std::endl;
23 o <<
"************" << std::endl;
24 o <<
"This class is used to model materials" << std::endl;
25 o <<
"Commands:" << std::endl;
26 o <<
"--------" << std::endl;
27 o <<
"a_material M: create a material named M" << std::endl;
28 o <<
"a_material M 'name' 'density': create a material named M with 'name' and 'density'" << std::endl;
29 o <<
"density 'd': sets the density to 'd'" << std::endl;
30 o <<
"density: gets the density" << std::endl;
31 o <<
"name 'n': sets the name of the material to 'n'" << std::endl;
32 o <<
"name: gets the name of the material" << std::endl;
40 std::size_t r1 = li.find_first_of(
'"');
41 std::size_t r2 = li.find(
'"',r1+1);
42 name_ = li.substr(r1,r2);
43 li2 = li.substr(r2+1,li.length());
44 std::istringstream in2(li2);
std::ostream & operator<<(std::ostream &o, const a_material &f)
std::istream & operator>>(std::istream &i, a_material &f)
virtual void read(std::istream &i)
static const std::string help()
get information about the class
virtual void write(std::ostream &o) const