path.h
/*
Programmer: Jennifer Leopold
Date: April 6, 2018
File: path.h
Purpose: This file contains the definition of a Path class.
*/
#ifndef PATH_H
#define PATH_H
#include <iostream>
#include <cstdlib>
using namespace std;
enum PathEntry {BLANK, WAIT_FOR_5_OR_8, JUNGLE, RHINO};
const unsigned int NUM_PATH_ENTRY_TYPES = 4;
const string PATH_ENTRIES[NUM_PATH_ENTRY_TYPES] =
{"Blank", "Wait for 5 or 8", "Jungle", "Rhino"};
class Path
{
private:
static const unsigned int NUM_POSITIONS_IN_PATH = 42;
static const unsigned int NUM_WAIT_FOR_5_OR_8_ENTRIES = 5;
static const unsigned int NUM_JUNGLE_ENTRIES = 3;
static const unsigned int NUM_RHINO_ENTRIES = 7;
PathEntry m_pathPositions[NUM_POSITIONS_IN_PATH];
unsigned int m_currentPosition;
public:
Path();
void randomlyPositionSpecialEntries
(const int numSpecialEntries, const PathEntry specialEntry);
unsigned int getCurrentPosition() const;
PathEntry getPathEntryAtPosition(const unsigned int pos) const;
friend ostream& operator <<(ostream& outs, const Path& p);
bool incrementCurrentPosition(const unsigned int n);
};
#endif