-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shop.cpp
79 lines (72 loc) · 1.76 KB
/
Shop.cpp
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <iostream>
#include <string>
#include <fstream>
#include <stdlib.h>
#include <time.h>
#include "Shop.h"
using namespace std;
//CS1300 Fall 2019
//Author: Char Donaldson
//Recitation: 105 - Michael Bradshaw
/*Algorithim:
Defines constructors and functions from Shop.h */
/* private:
int req; //requirement for charisma, pass/fail
string item1;
string item2;
*/
Shop::Shop(){
req = 6; //default charisma requirement
shopName = "Error! MissingShop";
}
void Shop::setReq(int n1){
req = n1;
}
void Shop::setName(string name){
shopName = name;
}
string Shop::getName(){
return shopName;
}
bool Shop::charCheck(int n1){
if(n1 >= req){
canShop = true;
return true;
}
if(n1 < req){
canShop = false;
return false;
}
else {return false;}
}
void Shop::setRarity(int r1){
rarity = r1;
}
int Shop::getRarity(){
return rarity;
}
string Shop::items(){
//items will be used in the buy_stuff function
return "";
}
void Shop::setShopkeeper(string shopk){ //name of shopkeeper
shopkeeper = shopk;
}
string Shop::getShopkeeper(){ //returns shopkeeper
return shopkeeper;
}
void Shop::setCurrency(int req){//sets currency needed to buy at shop
currencyReq = req;
}
int Shop::getCurrency(){
return currencyReq;
}
void Shop::setPower(int p1){ //POWER OF POTION SOLD AT SHOP
power = p1;
}
int Shop::getPower(){
return power;
}
int Shop::getReq() {
return req;
}