Пример #1
0
// Don't change this.  Make Read conform to it.
ostream &PylosBoard::Write(ostream &os) const {
   Rules rls = mRules;
   list<Move *>::const_iterator itr;
   int mvCount = EndianXfer((int)mMoveHist.size());

   rls.EndSwap();
   os.write((char *)&rls, sizeof(rls));

   os.write((char *)&mvCount, sizeof(mvCount));
   for (itr = mMoveHist.begin(); itr != mMoveHist.end(); itr++)
      os << **itr;

   return os;
}
Пример #2
0
ostream &CheckersBoard::Write(ostream &os) const { 
   Rules rules = mRules;
   list<Move *>::const_iterator iter;
   int moveCount = EndianXfer((int)mMoveHist.size());

   rules.EndSwap();
   os.write((char *)&rules, sizeof(rules));

   os.write((char *)&moveCount, sizeof(moveCount));
   for (iter = mMoveHist.begin(); iter != mMoveHist.end(); iter++)
      os << **iter;

   return os;
}