//ItemClass.cpp #include "ItemClass.h" //Default Constructor ItemClass::ItemClass() { ItemName = "XXX"; ItemType = "XXX"; ItemAuthor = "XXX"; ItemOwnerEmail = "XXX"; ItemPrice = "XXX"; ItemStatus = null; } //Default Destructor ItemClass::~ItemClass() {} //*********************************************************************************** // ItemClass::ItemLoad // // Initializes the checker boards as well as some other variable // // Parameters: // Name - Name of Item // Type - Media type // Author - Author of Media // Email - Email of Owner // Price - Price of Item // Status - Rental Status // // Pre: Nothing // Post: Sets Variables for array record // Returns: None // Called by: ManageClass // Calls: None //************************************************************************************ void ItemClass::ItemLoad(string Name, string Type, string Author, string Email, string Price, special Status) { if (ItemName == "XXX") ItemName = Name; if (ItemType == "XXX") ItemType = Type; if (ItemAuthor == "XXX") ItemAuthor = Author; if (ItemOwnerEmail == "XXX") ItemOwnerEmail = Email; if (ItemPrice == "XXX") ItemPrice = Price; if (ItemStatus == null) ItemStatus = Status; } //*********************************************************************************** // ItemClass::ItemPresent // // Returns weather or not Item is present in array record // // Parameters: // None // Pre: Nothing // Post: All the checker boards will be at game start positions and all parameter // variables will be zero. // Returns: True or False // Called by: ManageClass // Calls: None //************************************************************************************ bool ItemClass::ItemPresent() { if (ItemOwnerEmail == "XXX") return false; else return true; } //*********************************************************************************** // ItemClass::ItemOwnerExist // // Returns true if Email exists in array record // // Parameters: // Email - Email to compare with Email in current record // // Pre: Nothing // Post: returns true if email exists in array record // Returns: True or False // Called by: Manage Class // Calls: None //************************************************************************************ bool ItemClass::ItemOwnerExist(string Email) { if (ItemOwnerEmail == Email) return true; else return false; } //*********************************************************************************** // ItemClass::ItemPrint // // Prints Item Data // // Parameters: // outfile - output stream for output file // printemail - flag for printing the Email // // Pre: Nothing // Post: Item Info printed to output file // Returns: Nothing // Called by: Manage Class // Calls: None //************************************************************************************ void ItemClass::ItemPrint(ostream& outfile,bool printemail) { if (ItemName != "XXX") outfile<<"Item:"<< endl<<" "<