From 4e00b8595a4a65b29a5576487c52a82ab99e3597 Mon Sep 17 00:00:00 2001 From: RoboDoig Date: Tue, 3 Sep 2024 13:22:35 +0100 Subject: [PATCH 1/2] Make TextureSequence a public class and add docstrings. --- Bonsai.Shaders/TextureSequence.cs | 33 ++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Bonsai.Shaders/TextureSequence.cs b/Bonsai.Shaders/TextureSequence.cs index bd83567dc..4b7e27d27 100644 --- a/Bonsai.Shaders/TextureSequence.cs +++ b/Bonsai.Shaders/TextureSequence.cs @@ -3,16 +3,33 @@ namespace Bonsai.Shaders { - class TextureSequence : Texture, ITextureSequence + /// + /// Represents a sequence of texture objects with an enumerator. + /// + public class TextureSequence : Texture, ITextureSequence { readonly TextureArray textures; + /// + /// Initializes a new instance of the class + /// with the specified number of texture objects in the internal . + /// + /// + /// The total number of texture objects in the . + /// public TextureSequence(int length) : base(0) { textures = new TextureArray(length); } + /// + /// Initializes a new instance of the class + /// with existing texture handles. + /// + /// + /// The texture handles. + /// public TextureSequence(int[] textures) { this.textures = new TextureArray(textures); @@ -23,8 +40,22 @@ public TextureArray Textures get { return textures; } } + /// + /// The target playback rate of the texture sequence. + /// public double PlaybackRate { get; set; } + /// + /// Returns an enumerator that iterates through all texture objects in + /// the sequence. + /// + /// + /// Boolean specifying whether the sequence should loop. + /// + /// + /// An enumerator that can be used to iterate through the texture objects + /// in the sequence. + /// public IEnumerator> GetEnumerator(bool loop) { var index = 0; From 97f9e221b67553406a400a15de8fe752b11ffc91 Mon Sep 17 00:00:00 2001 From: RoboDoig Date: Tue, 3 Sep 2024 13:24:20 +0100 Subject: [PATCH 2/2] Add missing docstring --- Bonsai.Shaders/TextureSequence.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Bonsai.Shaders/TextureSequence.cs b/Bonsai.Shaders/TextureSequence.cs index 4b7e27d27..1f12f04c9 100644 --- a/Bonsai.Shaders/TextureSequence.cs +++ b/Bonsai.Shaders/TextureSequence.cs @@ -35,6 +35,9 @@ public TextureSequence(int[] textures) this.textures = new TextureArray(textures); } + /// + /// Gets the associated with this texture sequence. + /// public TextureArray Textures { get { return textures; }