| 1338 | } |
| 1339 | |
| 1340 | void Seat::addSkillPoints(int32_t points) |
| 1341 | { |
| 1342 | // Even if we are not searching anything, we allow to bring back a skill book if |
| 1343 | // we find any |
| 1344 | mSkillPoints += points; |
| 1345 | if(mCurrentSkill == nullptr) |
| 1346 | { |
| 1347 | mCurrentSkillType = SkillType::nullSkillType; |
| 1348 | return; |
| 1349 | } |
| 1350 | |
| 1351 | if(mSkillPoints < mCurrentSkill->getNeededSkillPoints()) |
| 1352 | { |
| 1353 | mCurrentSkillType = mCurrentSkill->getType(); |
| 1354 | mCurrentSkillProgress = static_cast<float>(mSkillPoints) / static_cast<float>(mCurrentSkill->getNeededSkillPoints()); |
| 1355 | return; |
| 1356 | } |
| 1357 | |
| 1358 | // The current skill is complete. We add it to the available skill list |
| 1359 | mSkillPoints -= mCurrentSkill->getNeededSkillPoints(); |
| 1360 | addSkill(mCurrentSkill->getType()); |
| 1361 | |
| 1362 | // We set the next skill |
| 1363 | setNextSkill(mCurrentSkill->getType()); |
| 1364 | } |
| 1365 | |
| 1366 | bool Seat::getCurrentSkillProgress(SkillType& type, float& progress) const |
| 1367 | { |
no test coverage detected