Using small vector.
This commit is contained in:
parent
bde031f393
commit
a693da20bf
2 changed files with 7 additions and 9 deletions
|
@ -9,8 +9,8 @@ namespace character {
|
|||
using characteristic::Characteristic;
|
||||
|
||||
void BillyObjects::push_object(const billyObject &object, CharacterSheet &sheet) noexcept {
|
||||
if (objects.size() < 3) {
|
||||
objects.emplace_back(object);
|
||||
if (sheet.objects.size() < 3) {
|
||||
sheet.objects.emplace_back(object);
|
||||
|
||||
auto &local_habilete = static_cast<Characteristic &>(sheet.habilete);
|
||||
auto &local_adresse = static_cast<Characteristic &>(sheet.adresse);
|
||||
|
@ -48,9 +48,9 @@ namespace character {
|
|||
}
|
||||
|
||||
void BillyObjects::pop_object(CharacterSheet &sheet) noexcept {
|
||||
if (!objects.empty()) {
|
||||
const billyObject obj = objects.back();
|
||||
objects.pop_back();
|
||||
if (!sheet.objects.empty()) {
|
||||
const billyObject obj = sheet.objects.back();
|
||||
sheet.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