Using svector
This commit is contained in:
parent
e6bec5c0f2
commit
a164593cd8
2 changed files with 8 additions and 11 deletions
|
@ -9,9 +9,8 @@ namespace character {
|
|||
using characteristic::Characteristic;
|
||||
|
||||
void BillyObjects::push_object(const billyObject &object, CharacterSheet &sheet) noexcept {
|
||||
if (end_object < 3) {
|
||||
objects.at(end_object) = object;
|
||||
++end_object;
|
||||
if (objects.size() < 3) {
|
||||
objects.emplace_back(object);
|
||||
|
||||
auto &local_habilete = static_cast<Characteristic &>(sheet.habilete);
|
||||
auto &local_adresse = static_cast<Characteristic &>(sheet.adresse);
|
||||
|
@ -49,9 +48,9 @@ namespace character {
|
|||
}
|
||||
|
||||
void BillyObjects::pop_object(CharacterSheet &sheet) noexcept {
|
||||
if (end_object > 0) {
|
||||
const auto &obj = objects.at(end_object - 1);
|
||||
--end_object;
|
||||
if (!objects.empty()) {
|
||||
const billyObject obj = objects.back();
|
||||
objects.pop_back();
|
||||
|
||||
auto &local_habilete = static_cast<Characteristic &>(sheet.habilete);
|
||||
auto &local_adresse = static_cast<Characteristic &>(sheet.adresse);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue