#if !defined(_WORLD_H)
#define _WORLD_H

#include <iostream.h>
#include "Prisoner.h"

class World {
public:
  virtual void example(int numRounds = 20) = 0;
    // MODIFIES: *this
    // EFFECT: run the prisoner's dilemma for numRounds rounds.
  virtual void print_results(ostream& o) = 0;
    // MODIFIES: o
    // EFFECT: Write a printed representation for the results
    // of w's tournament on o.
protected:
  void play_against(Prisoner* fst, Prisoner* snd, int numRounds) {
    // MODIFIES: *fst, *snd
    // EFFECT: play *fst against *snd for numRounds
    // newRound really means ``new partner''
    fst->newRound();   // These were fixed.
    snd->newRound();
    for (int i = 1; i <= numRounds; i++) {
      one_round(fst, snd);
    }
  }
  virtual void one_round(Prisoner* fst, Prisoner* snd);
    // MODIFIES: *fst, *snd
    // EFFECT: play *fst against *snd for numRounds
};
#endif

