| 687 | } |
| 688 | |
| 689 | bool SerialiseCommand(DataSerialiser& serialiser, ReplayCommand& command) |
| 690 | { |
| 691 | serialiser << command.tick; |
| 692 | serialiser << command.commandIndex; |
| 693 | |
| 694 | uint32_t actionType = 0; |
| 695 | if (serialiser.IsSaving()) |
| 696 | { |
| 697 | if (!command.action) |
| 698 | { |
| 699 | return false; |
| 700 | } |
| 701 | actionType = EnumValue(command.action->GetType()); |
| 702 | } |
| 703 | serialiser << actionType; |
| 704 | |
| 705 | if (serialiser.IsLoading()) |
| 706 | { |
| 707 | command.action = Create(static_cast<GameCommand>(actionType)); |
| 708 | } |
| 709 | |
| 710 | Guard::Assert(command.action != nullptr); |
| 711 | command.action->Serialise(serialiser); |
| 712 | |
| 713 | return true; |
| 714 | } |
| 715 | |
| 716 | bool Compatible(ReplayRecordData& data) |
| 717 | { |