Skip to content

Commit

Permalink
Move Select into constructor body
Browse files Browse the repository at this point in the history
  • Loading branch information
bijington committed Mar 3, 2024
1 parent 2801362 commit 1c9b11f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engine/Orbit.Engine/Sprite.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Orbit;
using System.Linq;

namespace Orbit.Engine;

/// <summary>
/// Provides the ability to render a sprite animation in a game.
Expand All @@ -18,8 +20,10 @@ public class Sprite : GameObject
/// <param name="imageDisplayDuration">How long each image should be displayed for before transitioning to the next image in the sequence.</param>
/// <param name="autoStart">Whether the sprite animation should start automatically.</param>
public Sprite(IReadOnlyList<string> imageNames, double imageDisplayDuration, bool autoStart = true)
: this(imageNames.Select(LoadImage).ToList(), imageDisplayDuration, autoStart)
{
this.images = imageNames.Select(LoadImage).ToList();
this.imageDisplayDuration = imageDisplayDuration;
this.isRunning = autoStart;
}

/// <summary>
Expand Down

0 comments on commit 1c9b11f

Please sign in to comment.