Added other classes.
This commit is contained in:
31
Location.cpp
Normal file
31
Location.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "Location.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
Location::Location()
|
||||
: name("Nowhere"),
|
||||
descriptions({"This is undefined, bruh.", "This doesn't exist, bruh."})
|
||||
{
|
||||
static bool initialized = false;
|
||||
if(!initialized)
|
||||
{
|
||||
initialized = true;
|
||||
srand(time(nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
Location::Location(std::string setName,
|
||||
std::vector<std::string> setDescriptions)
|
||||
: name(setName),
|
||||
descriptions(setDescriptions)
|
||||
{
|
||||
}
|
||||
|
||||
const std::string& Location::getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
const std::string& Location::getDescription() const
|
||||
{
|
||||
return descriptions[rand() % descriptions.size()];
|
||||
}
|
||||
Reference in New Issue
Block a user