Guest User

Untitled

a guest
Apr 7th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. class Entity
  2. {
  3.     struct mobs_normal
  4.     {
  5.     int id;
  6.     string name;
  7.     int lvl;
  8.     int dmg_min;
  9.     int dmg_max;
  10.     int hp;
  11.     int crit_chance;
  12.     };
  13.  
  14. void load()
  15. {
  16.  
  17. // tablica obiektow struktury
  18. mobs_normal mob_normal[11];
  19.  
  20. // baza z danymi mobow
  21. fstream file_mobs_normal;
  22. file_mobs_normal.open("entity/file_mobs_normal.txt", ios::in );
  23.  
  24. if (!file_mobs_normal.good() )  {error("file_mobs_normal.txt"); }
  25.  
  26. for (int i=0; i < 11; i++ )
  27.     {
  28.        file_mobs_normal >> mob_normal[i].name;
  29.        file_mobs_normal >> mob_normal[i].lvl;
  30.        file_mobs_normal >> mob_normal[i].dmg_min;
  31.        file_mobs_normal >> mob_normal[i].dmg_max;
  32.        file_mobs_normal >> mob_normal[i].hp;
  33.        file_mobs_normal >> mob_normal[i].crit_chance;
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment