#include <string>
#include "person.h"

// default constructor, no parameters
// goal of constructors: initialize member variables.
Person::Person(){
	name = "Joe";
	age = 30;
	gender = "Male";
}

Person::Person(std::string n, int a, std::string g){
	name = n;
	age = a;
	gender = g;
}

Person::Person(const Person& other){
	name = other.name;
	age = other.age;
	gender = other.gender;
}

// getter
std::string Person::getName() const {
	return name;
}

// setter
void Person::setName(std::string n){
	name = n;
}

// non-member function
bool compareByAge(const Person& A, const Person& B){
	// return A.age < B.age;
	return A.getAge() < B.getAge();
}

bool operator==(const Person& A, const Person& B){
	if((A.getAge() == B.getAge()) && (A.getName() == B.getName()) && (A.getGender() == B.getGender())){
		return true;
	}else{
		return false;
	}
}

// A == B, A > B, A + B, A - B??
bool operator<(const Person& A, const Person& B){
	return A.getAge() < B.getAge();
}
