StartInfo.h 800 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef STARTINFO_H
  2. #define STARTINFO_H
  3. #include "global.h"
  4. #include <vector>
  5. enum Ebonus {brandom=-1,bartifact, bgold, bresource};
  6. struct StartInfo
  7. {
  8. struct PlayerSettings
  9. {
  10. int castle, hero, //ID, if -1 then random, if -2 then none
  11. heroPortrait; //-1 if default, else ID
  12. std::string heroName;
  13. Ebonus bonus;
  14. Ecolor color; //from 0 -
  15. int handicap;//0-no, 1-mild, 2-severe
  16. std::string name;
  17. };
  18. int difficulty; //0=easy; 4=impossible
  19. std::vector<PlayerSettings> playerInfos;
  20. int turnTime; //in minutes, 0=unlimited
  21. PlayerSettings & getIthPlayersSettings(int no)
  22. {
  23. for(int i=0; i<playerInfos.size(); ++i)
  24. if(playerInfos[i].color == no)
  25. return playerInfos[i];
  26. throw new std::exception("Cannot find info about player");
  27. }
  28. };
  29. #endif