Kirooos

Untitled

Jun 1st, 2025
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "refine.h"
  3.  
  4. CRefineManager::CRefineManager()
  5. {
  6. }
  7.  
  8. CRefineManager::~CRefineManager()
  9. {
  10. }
  11.  
  12. bool CRefineManager::Initialize(TRefineTable * table, int size)
  13. {
  14. for (int i = 0; i < size; ++i, ++table)
  15. {
  16. sys_log(0, "REFINE %d prob %d cost %d", table->id, table->prob, table->cost);
  17. m_map_RefineRecipe.insert(std::make_pair(table->id, *table));
  18. }
  19.  
  20. sys_log(0, "REFINE: COUNT %d", m_map_RefineRecipe.size());
  21. return true;
  22. }
  23.  
  24. const TRefineTable* CRefineManager::GetRefineRecipe(DWORD vnum)
  25. {
  26. if (vnum == 0)
  27. return NULL;
  28.  
  29. itertype(m_map_RefineRecipe) it = m_map_RefineRecipe.find(vnum);
  30. sys_log(0, "REFINE: FIND %u %s", vnum, it == m_map_RefineRecipe.end() ? "FALSE" : "TRUE");
  31.  
  32. if (it == m_map_RefineRecipe.end())
  33. {
  34. return NULL;
  35. }
  36.  
  37. return &it->second;
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment