-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresources.cpp
More file actions
executable file
·27 lines (23 loc) · 857 Bytes
/
resources.cpp
File metadata and controls
executable file
·27 lines (23 loc) · 857 Bytes
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
// the resources.cpp file, this file handles the resources struct
// and all methods relating to resources
#include "includes.hpp"
#include "resources.hpp"
// Resource constructor, sets name, max available,
// and currently available
Resource::Resource(string name, int max_available){
this->name = name;
this->max_available = max_available;
this->currently_available = max_available;
}
// Another resource constructor, sets name, max available,
// and currently available with empty values
Resource::Resource(){
this->name = "";
this->max_available = -1;
this->currently_available = -1;
}
// prints all of the information for a resource
void Resource::print(){
printf("%s: (MaxAvail= %d, held= %d)\n",
this->name.c_str(), this->max_available, this->max_available - this->currently_available);
}