diff --git a/Telegrator/Attributes/Components/StateKeeperAttributeBase.cs b/Telegrator/Attributes/Components/StateKeeperAttributeBase.cs index ba69146..9f67911 100644 --- a/Telegrator/Attributes/Components/StateKeeperAttributeBase.cs +++ b/Telegrator/Attributes/Components/StateKeeperAttributeBase.cs @@ -1,7 +1,7 @@ using Telegram.Bot.Types; using Telegrator.Filters.Components; using Telegrator.Handlers.Components; -using Telegrator.StateKeeping.Components; +using Telegrator.StateKeeping.Abstracts; namespace Telegrator.Attributes.Components { diff --git a/Telegrator/Attributes/StateKeeperAttribute.cs b/Telegrator/Attributes/StateKeeperAttribute.cs index dcf0e02..276dfc9 100644 --- a/Telegrator/Attributes/StateKeeperAttribute.cs +++ b/Telegrator/Attributes/StateKeeperAttribute.cs @@ -2,6 +2,7 @@ using Telegrator.Annotations.StateKeeping; using Telegrator.Attributes.Components; using Telegrator.Filters.Components; +using Telegrator.StateKeeping.Abstracts; using Telegrator.StateKeeping.Components; namespace Telegrator.Attributes diff --git a/Telegrator/Handlers/Building/Components/HandlerBuilderBase.cs b/Telegrator/Handlers/Building/Components/HandlerBuilderBase.cs index eb2d360..e753beb 100644 --- a/Telegrator/Handlers/Building/Components/HandlerBuilderBase.cs +++ b/Telegrator/Handlers/Building/Components/HandlerBuilderBase.cs @@ -5,6 +5,7 @@ using Telegrator.Filters.Components; using Telegrator.Handlers.Components; using Telegrator.MadiatorCore; using Telegrator.MadiatorCore.Descriptors; +using Telegrator.StateKeeping.Abstracts; using Telegrator.StateKeeping.Components; namespace Telegrator.Handlers.Building.Components diff --git a/Telegrator/Handlers/Building/Components/IHandlerBuilder.cs b/Telegrator/Handlers/Building/Components/IHandlerBuilder.cs index f280f4d..bfa3b3a 100644 --- a/Telegrator/Handlers/Building/Components/IHandlerBuilder.cs +++ b/Telegrator/Handlers/Building/Components/IHandlerBuilder.cs @@ -1,6 +1,7 @@ using Telegram.Bot.Types; using Telegrator.Annotations.StateKeeping; using Telegrator.Filters.Components; +using Telegrator.StateKeeping.Abstracts; using Telegrator.StateKeeping.Components; namespace Telegrator.Handlers.Building.Components diff --git a/Telegrator/Handlers/Building/Components/StateKeepFilter.cs b/Telegrator/Handlers/Building/Components/StateKeepFilter.cs index 41534e4..432c5ca 100644 --- a/Telegrator/Handlers/Building/Components/StateKeepFilter.cs +++ b/Telegrator/Handlers/Building/Components/StateKeepFilter.cs @@ -2,6 +2,7 @@ using Telegrator.Annotations.StateKeeping; using Telegrator.Filters; using Telegrator.Filters.Components; +using Telegrator.StateKeeping.Abstracts; using Telegrator.StateKeeping.Components; namespace Telegrator.Handlers.Building.Components diff --git a/Telegrator/StateKeeping/ArrayStateKeeper.cs b/Telegrator/StateKeeping/Abstracts/ArrayStateKeeper.cs similarity index 97% rename from Telegrator/StateKeeping/ArrayStateKeeper.cs rename to Telegrator/StateKeeping/Abstracts/ArrayStateKeeper.cs index 120cf01..13f738b 100644 --- a/Telegrator/StateKeeping/ArrayStateKeeper.cs +++ b/Telegrator/StateKeeping/Abstracts/ArrayStateKeeper.cs @@ -1,6 +1,4 @@ -using Telegrator.StateKeeping.Components; - -namespace Telegrator.StateKeeping +namespace Telegrator.StateKeeping.Abstracts { /// /// Abstract base class for state keepers that manage state transitions using an array of predefined states. diff --git a/Telegrator/StateKeeping/Components/StateKeeperBase.cs b/Telegrator/StateKeeping/Abstracts/StateKeeperBase.cs similarity index 98% rename from Telegrator/StateKeeping/Components/StateKeeperBase.cs rename to Telegrator/StateKeeping/Abstracts/StateKeeperBase.cs index e2e0193..e94681d 100644 --- a/Telegrator/StateKeeping/Components/StateKeeperBase.cs +++ b/Telegrator/StateKeeping/Abstracts/StateKeeperBase.cs @@ -1,6 +1,7 @@ using Telegram.Bot.Types; +using Telegrator.StateKeeping.Components; -namespace Telegrator.StateKeeping.Components +namespace Telegrator.StateKeeping.Abstracts { /// /// Base class for managing state associated with updates and keys. diff --git a/Telegrator/StateKeeping/Abstracts/UpdateBasedStateKeeperBase.cs b/Telegrator/StateKeeping/Abstracts/UpdateBasedStateKeeperBase.cs new file mode 100644 index 0000000..202c705 --- /dev/null +++ b/Telegrator/StateKeeping/Abstracts/UpdateBasedStateKeeperBase.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Telegrator.StateKeeping.Abstracts +{ + /* + public class UpdateBasedStateKeeperBase + { + } + */ +} diff --git a/Telegrator/StateKeeping/Components/IStateKeepingFacility.cs b/Telegrator/StateKeeping/Components/IStateKeepingFacility.cs new file mode 100644 index 0000000..d083609 --- /dev/null +++ b/Telegrator/StateKeeping/Components/IStateKeepingFacility.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Telegrator.StateKeeping.Components +{ + /* + public interface IStateKeepingFacility + { + public void SetState(object key, object value); + + public object GetState(object key); + } + */ +} diff --git a/Telegrator/StateKeeping/EnumStateKeeper.cs b/Telegrator/StateKeeping/EnumStateKeeper.cs index 54ce103..1163e6e 100644 --- a/Telegrator/StateKeeping/EnumStateKeeper.cs +++ b/Telegrator/StateKeeping/EnumStateKeeper.cs @@ -1,6 +1,6 @@ using Telegrator.Annotations.StateKeeping; using Telegrator.Handlers.Components; -using Telegrator.StateKeeping; +using Telegrator.StateKeeping.Abstracts; namespace Telegrator.StateKeeping { diff --git a/Telegrator/StateKeeping/Facilities/JsonStateKeepingFacility.cs b/Telegrator/StateKeeping/Facilities/JsonStateKeepingFacility.cs new file mode 100644 index 0000000..5fb45a3 --- /dev/null +++ b/Telegrator/StateKeeping/Facilities/JsonStateKeepingFacility.cs @@ -0,0 +1,8 @@ +namespace Telegrator.StateKeeping.Facilities +{ + /* + public class JsonStateKeepingFacility : IStateKeepingFacility + { + } + */ +} diff --git a/Telegrator/StateKeeping/NumericStateKeeper.cs b/Telegrator/StateKeeping/NumericStateKeeper.cs index b8ea824..e5e2122 100644 --- a/Telegrator/StateKeeping/NumericStateKeeper.cs +++ b/Telegrator/StateKeeping/NumericStateKeeper.cs @@ -1,6 +1,6 @@ using Telegrator.Annotations.StateKeeping; using Telegrator.Handlers.Components; -using Telegrator.StateKeeping.Components; +using Telegrator.StateKeeping.Abstracts; namespace Telegrator.StateKeeping { diff --git a/Telegrator/StateKeeping/StringStateKeeper.cs b/Telegrator/StateKeeping/StringStateKeeper.cs index 8c8fc5a..a34660c 100644 --- a/Telegrator/StateKeeping/StringStateKeeper.cs +++ b/Telegrator/StateKeeping/StringStateKeeper.cs @@ -1,13 +1,13 @@ using Telegrator.Annotations.StateKeeping; using Telegrator.Handlers.Components; -using Telegrator.StateKeeping.Components; +using Telegrator.StateKeeping.Abstracts; namespace Telegrator.StateKeeping { /// /// State keeper that manages string-based states for chat sessions. /// - public class StringStateKeeper() : StateKeeperBase() + public class StringStateKeeper() : StateKeeperBase() { /// /// Gets the default state value, which is an empty string. @@ -15,13 +15,13 @@ namespace Telegrator.StateKeeping public override string DefaultState => string.Empty; /// - protected override string MoveBackward(string currentState, string currentKey) + protected override string MoveBackward(string currentState, long currentKey) { throw new NotImplementedException(); } /// - protected override string MoveForward(string currentState, string currentKey) + protected override string MoveForward(string currentState, long currentKey) { throw new NotImplementedException(); } @@ -63,8 +63,10 @@ namespace Telegrator.StateKeeping public static void SetStringState(this IHandlerContainer container, string? newState) => container.StringStateKeeper().SetState(container.HandlingUpdate, newState ?? StringStateAttribute.DefaultState); + /* public static string GetStringState(this IHandlerContainer container, string key) => container.StringStateKeeper().GetState() + */ /* /// diff --git a/Telegrator/TypesExtensions.cs b/Telegrator/TypesExtensions.cs index c190d24..ca53be1 100644 --- a/Telegrator/TypesExtensions.cs +++ b/Telegrator/TypesExtensions.cs @@ -18,6 +18,7 @@ using Telegrator.MadiatorCore; using Telegrator.MadiatorCore.Descriptors; using Telegrator.Providers; using Telegrator.StateKeeping; +using Telegrator.StateKeeping.Abstracts; using Telegrator.StateKeeping.Components; namespace Telegrator