Advertisement
JangoBingoBango

MonsterManager.h

Apr 13th, 2020
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. #pragma once
  2. #include <iostream>
  3. #include <list>
  4. #include <Monster>
  5. #include <string>
  6.  
  7. namespace std
  8. {
  9.     class MonsterManager  
  10.     {
  11.         // Empty list of Monsters
  12.         list<Monster> monsterList;
  13.  
  14.         // Populate the monsterList
  15.         void createMonsterList()
  16.         {
  17.             int min = 1;
  18.             int max = 2;
  19.             // Picks a random number from min to max
  20.             int range = rand() % max + min;
  21.             Monster monster;
  22.  
  23.             // create 'x' amount of monsters and add them to monster list
  24.             for (int i = 0; i < range; i++)
  25.             {
  26.                 // insert code to create or select monster
  27.                 monster = ...;
  28.                 // add monster to end of monsterList
  29.                 monsterList.push_back(monster)
  30.             }
  31.         }
  32.  
  33.         // Returns and removes the monster from the front of the monsterList
  34.         Monster getNextMonster()
  35.         {
  36.             return monsterList.pop_front();
  37.         }
  38.  
  39.         // Returns monster count of monsterList
  40.         int getMonsterCount()
  41.         {
  42.             return monsterList.size();
  43.         }
  44.     };
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement