Advertisement
bekovski

header

Nov 6th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include <string>
  4. #include <cstdlib>
  5. #include <vector>
  6.  
  7. enum Race {dwarf, elf, human, ork, gnome};
  8.  
  9. enum Class {Monk, Paladin, Ranger, Mage, Fighter};
  10.  
  11.  
  12.  
  13. class NPC {
  14.     std::string name;
  15.     int char_rating;
  16.     Race race;
  17.     Class clazz;
  18.     int xp;
  19.     int hp;
  20.     // ...
  21.     std::vector<double> vec;
  22.    
  23.   public:
  24.     void update() {
  25.         static int counter = 0;
  26.         name        = "npc " + std::to_string(counter++);
  27.         char_rating = rand() % 100 + 1;
  28.         race        = Race(rand() % 5);
  29.         clazz       = Class(rand() % 5);
  30.         int xp      = rand() % 100;
  31.         int hp      = rand() % 101;
  32.        
  33.         /**/
  34.         for(int i=0; i < 1000; ++i) {
  35.             vec.push_back(i);
  36.         }
  37.     }
  38.    
  39.     std::string getName() {
  40.         return name;
  41.     }
  42. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement