/*
 * Method definitions for a Cat.
 * 
 * Author: Zach Tomaszewski
 */
#include <iostream>
#include "Cat.hpp"

using std::cout;
using std::endl;
using std::string;

/* Constructor */
Cat::Cat(const string name, const string owner, int lives) : Pet(name, owner) {
  // Note the " : Pet(name, owner)".  This calls the superclass constructor.
  // This is basically equivalent to Java's "super(name, owner);".  You only
  // have to do this if there is no constructor that takes no parameters
  // in the super class.
  this->lives = lives;
}

/* Tries to override's Pet's getOwner to represent a Cat's independent nature. */
string Cat::getOwner() {
  //This is an example of how you call a super class version of a function
  return Pet::getOwner() + " (sort of)";
}

/* Override's Pet's speak() so that Cat's meow. */
string Cat::speak() {
  return getName() + " meows.";
}


/* Reduces this Cat's lives by 1 if not already 0 or less. */
void Cat::badLuck() {
  if (lives > 0) {
    lives--;
  }
}

int Cat::getLives() {
  return lives;
}
