+void PlayerStatus::reset()
+{
+ distros = 0;
+ lives = START_LIVES;
+ bonus = NO_BONUS;
+ score_multiplier = 1;
+ max_score_multiplier = 1;
+}
+
+void
+PlayerStatus::incLives()
+{
+ if(lives < MAX_LIVES)
+ ++lives;
+ SoundManager::get()->play_sound(IDToSound(SND_LIFEUP));
+}
+
+void
+PlayerStatus::incCoins()
+{
+ distros++;
+ if(distros >= 100) {
+ incLives();
+ distros = 0;
+ }
+ SoundManager::get()->play_sound(IDToSound(SND_DISTRO));
+}
+
+std::string bonus_to_string(PlayerStatus::BonusType b)
+{
+ switch (b)
+ {
+ case PlayerStatus::NO_BONUS:
+ return "none";
+ case PlayerStatus::GROWUP_BONUS:
+ return "growup";
+ case PlayerStatus::FLOWER_BONUS:
+ return "iceflower";
+ default:
+ return "none";
+ }
+}
+
+PlayerStatus::BonusType string_to_bonus(const std::string& str)
+{
+ if (str == "none")
+ return PlayerStatus::NO_BONUS;
+ else if (str == "growup")
+ return PlayerStatus::GROWUP_BONUS;
+ else if (str == "iceflower")
+ return PlayerStatus::FLOWER_BONUS;
+ else
+ return PlayerStatus::NO_BONUS;
+}