using System.Collections.Generic; using UnityEngine; namespace Code.OfficeGame.BattleMode.Actions { public class AttackBattleActionData : BattleActionData { public int CurrentFrame; public int TransitionFrames; public Quaternion StartRotation; public HashSet HitEntities = new(); public override BattleActionData GetSnapshot() { return new AttackBattleActionData { TotalFrames = TotalFrames, Finished = Finished, CurrentFrame = CurrentFrame, TransitionFrames = TransitionFrames, StartRotation = StartRotation, HitEntities = new HashSet(HitEntities) }; } public override void RestoreSnapshot(BattleActionData snapshot) { if (snapshot is not AttackBattleActionData neededSnapshot) return; TotalFrames = neededSnapshot.TotalFrames; Finished = neededSnapshot.Finished; CurrentFrame = neededSnapshot.CurrentFrame; TransitionFrames = neededSnapshot.TransitionFrames; StartRotation = neededSnapshot.StartRotation; HitEntities = new HashSet(neededSnapshot.HitEntities); } } }