38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
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<EntityId> HitEntities = new();
|
|
|
|
public override BattleActionData GetSnapshot()
|
|
{
|
|
return new AttackBattleActionData
|
|
{
|
|
TotalFrames = TotalFrames,
|
|
Finished = Finished,
|
|
CurrentFrame = CurrentFrame,
|
|
TransitionFrames = TransitionFrames,
|
|
StartRotation = StartRotation,
|
|
HitEntities = new HashSet<EntityId>(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<EntityId>(neededSnapshot.HitEntities);
|
|
}
|
|
}
|
|
} |