Example #1
0
void Bonded::show(std::ostream &out) const {
  if (*this == Bonded()) {
    out << "Null Bonded";
    return;
  }
  out << "Particle " << get_particle()->get_name() << " is bonded to ";
  for (unsigned int i = 0; i < get_number_of_bonds(); ++i) {
    Bond b = get_bond(i);
    if (b.get_bonded(0) == *this) {
      out << b.get_bonded(1).get_particle()->get_name();
    } else {
      out << b.get_bonded(0).get_particle()->get_name();
    }
    out << " ";
  }
}