StartInfo.h 830 B

1234567891011121314151617181920212223242526272829303132333435
  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 serial;
  16. int handicap;//0-no, 1-mild, 2-severe
  17. std::string name;
  18. bool human;
  19. };
  20. int difficulty; //0=easy; 4=impossible
  21. std::vector<PlayerSettings> playerInfos;
  22. int turnTime; //in minutes, 0=unlimited
  23. PlayerSettings & getIthPlayersSettings(int no)
  24. {
  25. for(int i=0; i<playerInfos.size(); ++i)
  26. if(playerInfos[i].color == no)
  27. return playerInfos[i];
  28. throw new std::exception("Cannot find info about player");
  29. }
  30. };
  31. #endif