this->wallet=std::move(seller_wallet);// unique pointers cannot be copied, but can only be moved // "std::unique_ptr::release()" is a similar function but "std::move()" is better of the two
}
////////////////////
////////////////////
////////////////////
@ -509,11 +501,6 @@ std::vector<unsigned int> neroshop::Seller::get_top_rated_sellers(unsigned int l
unsignedintget_good_ratings()const;// returns the total number of good ratings given to this seller by their customers
unsignedintget_bad_ratings()const;// returns the total number of bad ratings given to this seller by their customers
@ -53,8 +50,6 @@ public:
unsignedintget_total_ratings()const;// same as get_ratings_count
unsignedintget_reputation()const;// returns a percentage of good ratings
staticstd::vector<unsignedint>get_top_rated_sellers(unsignedintlimit=50);// returns a container of n seller_ids with the most positive (good) ratings // the default value of n is 50
////if(account_type_id != 2) {neroshop::print("This user (id: " + seller_id + ") is not a seller, so they cannot be rated", 2); return;}//if(String::lower(account_type) != "seller") {neroshop::print("You cannot rate a non-seller");return;}
/*// To prevent duplicating seller_id that is has already been rated by this user_id (a user cannot rate the same seller twice, except update his or her score rating for a specific seller_id
std::cout<<"\033[1;37;49mYour rating for seller ("+seller_id+") has been updated (score: "<<((score!=0)?"\033[1;32m":"\033[1;91m")+std::to_string(score)<<"\033[1;37;49m)\033[0m\n";
return;
}
}
@ -269,7 +288,7 @@ void neroshop::User::rate_item(const std::string& product_id, int stars, const s
// Check if the rater (you) has not already rated this product
returnfalse;////return (std::find(favorites.begin(), favorites.end(), product_id) != favorites.end()); // this is good for when storing favorites as integers (product_ids)
}
////////////////////
boolneroshop::User::has_wallet()const{
if(!wallet.get())returnfalse;// wallet is nullptr
if(!wallet->get_monero_wallet())returnfalse;// wallet not opened
returntrue;
}
////////////////////
boolneroshop::User::has_wallet_synced()const{
if(!has_wallet())returnfalse;// wallet is either nullptr or not opened
if(!wallet->get_monero_wallet()->is_synced())returnfalse;// wallet not synced to daemon