Guest User

Untitled

a guest
Apr 18th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include "MawKit/KVDatabase.hpp"
  2.  
  3. bool buyIfPossible( long long price )
  4. {
  5. constexpr const char *moneyKey = "money";
  6.  
  7. if ( MK::KVDatabase::getLongValueForKey( moneyKey ) > price ) {
  8. MK::KVDatabase::decreaseLongValueForKey( moneyKey, price );
  9. return true;
  10. }
  11.  
  12. return false;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment