BattleAction.h 1008 B

1234567891011121314151617181920212223242526
  1. #ifndef __BATTLEACTION_H__
  2. #define __BATTLEACTION_H__
  3. /*
  4. * BattleAction.h, part of VCMI engine
  5. *
  6. * Authors: listed in file AUTHORS in main folder
  7. *
  8. * License: GNU General Public License v2.0 or later
  9. * Full text of license available in license.txt file, in main folder
  10. *
  11. */
  12. struct BattleAction
  13. {
  14. ui8 side; //who made this action: false - left, true - right player
  15. ui32 stackNumber;//stack ID, -1 left hero, -2 right hero,
  16. ui8 actionType; // 0 = No action; 1 = Hero cast a spell 2 = Walk 3 = Defend 4 = Retreat from the battle 5 = Surrender 6 = Walk and Attack 7 = Shoot 8 = Wait 9 = Catapult 10 = Monster casts a spell (i.e. Faerie Dragons) 11 - Bad morale freeze
  17. ui16 destinationTile;
  18. si32 additionalInfo; // e.g. spell number if type is 1 || 10; tile to attack if type is 6
  19. template <typename Handler> void serialize(Handler &h, const int version)
  20. {
  21. h & side & stackNumber & actionType & destinationTile & additionalInfo;
  22. }
  23. };
  24. #endif // __BATTLEACTION_H__