Browse Source

Added 'erase' function to RenX::LadderDatabase

pull/3/head
Jessica James 9 years ago
parent
commit
6d14569478
  1. BIN
      Release/Plugins/RenX.Core.lib
  2. 15
      RenX.Core/RenX_LadderDatabase.cpp
  3. 5
      RenX.Core/RenX_LadderDatabase.h

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

15
RenX.Core/RenX_LadderDatabase.cpp

@ -467,3 +467,18 @@ void RenX::LadderDatabase::updateLadder(RenX::Server *server, const RenX::TeamTy
}
}
}
void RenX::LadderDatabase::erase()
{
if (RenX::LadderDatabase::head != nullptr)
{
while (RenX::LadderDatabase::head->next != nullptr)
{
RenX::LadderDatabase::head = head->next;
delete head->prev;
}
delete RenX::LadderDatabase::head;
RenX::LadderDatabase::head = nullptr;
RenX::LadderDatabase::end = nullptr;
}
}

5
RenX.Core/RenX_LadderDatabase.h

@ -169,6 +169,11 @@ namespace RenX
*/
void updateLadder(RenX::Server *server, const RenX::TeamType &team, bool output_times);
/**
* @brief Erases all entries in the database.
*/
void erase();
/**
* @brief Constructor for the LadderDatabase class
*/

Loading…
Cancel
Save