canvi de pc

This commit is contained in:
2025-02-27 07:37:39 +01:00
parent e6fd4225a2
commit c6474cb2da
26 changed files with 903 additions and 991 deletions

View File

@@ -46,12 +46,12 @@ void ItemTracker::addItem(const std::string &name, SDL_Point pos)
// Primero busca si ya hay una entrada con ese nombre
if (const int index = findByName(name); index != -1)
{
list.at(index).pos.push_back(pos);
item_list_.at(index).pos.push_back(pos);
}
// En caso contrario crea la entrada
else
{
list.emplace_back(name, pos);
item_list_.emplace_back(name, pos);
}
}
}
@@ -61,7 +61,7 @@ int ItemTracker::findByName(std::string name)
{
int i = 0;
for (const auto &l : list)
for (const auto &l : item_list_)
{
if (l.name == name)
{
@@ -78,7 +78,7 @@ int ItemTracker::findByPos(int index, SDL_Point pos)
{
int i = 0;
for (const auto &l : list[index].pos)
for (const auto &l : item_list_[index].pos)
{
if ((l.x == pos.x) && (l.y == pos.y))
{