#if !defined(_PRISONER_H)
#define _PRISONER_H
#include <iostream.h>
#include "Decision.h"

class Prisoner {
public:
  virtual void newRound() = 0;
    // MODIFIES: *this
    // EFFECT: discard any history information,
    // as a new partner in the dilemma has arrived.
  virtual Decision decide() = 0;
    // MODIFIES: *this
    // EFFECT: decide whether to cooperate or defect.
  virtual void yours_others(Decision yours, Decision others) {
    // MODIFIES: *this
    // EFFECT: record the winnings from this round.
    // You will need to override this to update any history variables.
    won += payoffFor(yours, others);
  }
  virtual const char *name() const = 0;
    // EFFECT: return the name of this strategy
  int winnings() const {
    // EFFECT: return this prisoner's winnings
    return won;
  }
  virtual void print_results(ostream& o) const {
    o << name() << " won " << winnings() << "\n";
  }
private:
  int won;  // perhaps ``years_in_jail'' would be better
};
#endif

