-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommonFuncs.h
49 lines (35 loc) · 1.09 KB
/
CommonFuncs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**************************************************
Project: The Tamer, the Arigamo and the Fuhai Gem
Task: Assignment 2 + 3
Author: Sean Lee
Purpose: Common Functons Header File
The Header file for Common Functions that
provide generic functionality to the game.
**************************************************/
#ifndef COMMONFUNC_H
#define COMMONFUNC_H
#include <iostream>
#include <ctime>
#include <limits>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;
// other functions
void pause();
void displayString(string input);
string stringUpperCase(string inputString);
// input functions
string getStringInput(string question);
int getIntIntput(string question, int min, int max);
char getCharInput(string question, char options[]);
bool getBoolInput(string question);
// validation functions
bool isNumber(const string& input);
bool areArgsValid(const vector<string>& arguments, const vector<string> validArgs);
// file functions
string loadFileAsString(string fileName);
vector<string> loadFileAsVector(string fileName);
#endif