Update `DoorComponent` to use TimeSpans and fix comments (#40420)

Cleanup
This commit is contained in:
Winkarst-cpu
2025-09-17 16:28:11 +03:00
committed by GitHub
parent 0dd1733998
commit ca47e59e43
2 changed files with 11 additions and 11 deletions

View File

@@ -31,7 +31,7 @@ public sealed class DoorSystem : SharedDoorSystem
comp.OpeningAnimation = new Animation
{
Length = TimeSpan.FromSeconds(comp.OpeningAnimationTime),
Length = comp.OpeningAnimationTime,
AnimationTracks =
{
new AnimationTrackSpriteFlick
@@ -47,7 +47,7 @@ public sealed class DoorSystem : SharedDoorSystem
comp.ClosingAnimation = new Animation
{
Length = TimeSpan.FromSeconds(comp.ClosingAnimationTime),
Length = comp.ClosingAnimationTime,
AnimationTracks =
{
new AnimationTrackSpriteFlick
@@ -63,7 +63,7 @@ public sealed class DoorSystem : SharedDoorSystem
comp.EmaggingAnimation = new Animation
{
Length = TimeSpan.FromSeconds(comp.EmaggingAnimationTime),
Length = comp.EmaggingAnimationTime,
AnimationTracks =
{
new AnimationTrackSpriteFlick
@@ -116,14 +116,14 @@ public sealed class DoorSystem : SharedDoorSystem
return;
case DoorState.Opening:
if (entity.Comp.OpeningAnimationTime == 0.0)
if (entity.Comp.OpeningAnimationTime == TimeSpan.Zero)
return;
_animationSystem.Play(entity, (Animation)entity.Comp.OpeningAnimation, DoorComponent.AnimationKey);
return;
case DoorState.Closing:
if (entity.Comp.ClosingAnimationTime == 0.0 || entity.Comp.CurrentlyCrushing.Count != 0)
if (entity.Comp.ClosingAnimationTime == TimeSpan.Zero || entity.Comp.CurrentlyCrushing.Count != 0)
return;
_animationSystem.Play(entity, (Animation)entity.Comp.ClosingAnimation, DoorComponent.AnimationKey);