BattleAction.h 668 B

12345678910111213
  1. #pragma once
  2. struct BattleAction
  3. {
  4. ui8 side; //who made this action: false - left, true - right player
  5. ui32 stackNumber;//stack ID, -1 left hero, -2 right hero,
  6. ui8 actionType; // 0 = Cancel BattleAction 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)
  7. ui16 destinationTile;
  8. si32 additionalInfo; // e.g. spell number if type is 1 || 10
  9. template <typename Handler> void serialize(Handler &h, const int version)
  10. {
  11. h & side & stackNumber & actionType & destinationTile & additionalInfo;
  12. }
  13. };