crimeroom.h
// Programmer: Bushra Anjum
// file: CrimeRoom.h
#ifndef CrimeRoom_h
#define CrimeRoom_h
#include "Resident.h"
#include <string>
#include <iostream>
using namespace std;
class CrimeRoom
{
private:
bool m_murder_committed;
int m_hair;
string m_dead_guy;
public:
/*Description: Constructor for CrimeRoom that provides initial
values to the CrimeRoom
Pre: None
Post: m_hair is set to 0, m_murder_committed is set to false
and m_dead_guy to an empty string*/
CrimeRoom();
/*Description: meeting() function takes two resident references
and with 50% probability commits a murder in the room
Pre: Two alive residents come in as parameters
Post: A murder is committed and appropriate variables are set*/
void meeting(Resident & r1, Resident & r2);
/*Description: murder() Generates a random boolean 50% true
Pre: None
Post: A "true" is returned 50% of the time*/
bool murder()const;
/*Description: check_room() if a murder has been committed, the
function prints the name of the dead guy
Pre: None
Post: If a murder is committed, the name of the dead guy is printed*/
void check_room()const;
/*Description: reset() function resets the values to initial
values of the CrimeRoom
Pre: None
Post: m_hair is set to 0, m_murder_committed is set to false
and m_dead_guy to an empty string*/
void reset();
};
#endif