From a295ea15b58f8490459926a91010b2cb228a84b1 Mon Sep 17 00:00:00 2001 From: Knose Date: Wed, 28 Jul 2021 21:18:40 +0200 Subject: [PATCH] Restructure project, add Spreads --- {Class => Classes}/ICard.cs | 0 {Class => Classes}/IDeck.cs | 2 -- Classes/ISpread.cs | 13 ++++++++ {Class => Classes}/TarotCard.cs | 0 {Class => Classes}/TarotDeck.cs | 0 Classes/TarotSpread.cs | 30 +++++++++++++++++++ {Class/MenuCLI => MenuCLI}/FuncEntry.cs | 0 {Class/MenuCLI => MenuCLI}/IMenu.cs | 0 {Class/MenuCLI => MenuCLI}/IMenuEntry.cs | 0 {Class/MenuCLI => MenuCLI}/MenuEntry.cs | 0 {Class/MenuCLI => MenuCLI}/MenuList.cs | 0 Class/Options.cs => Options.cs | 0 .../ISubscribable.cs | 0 .../ISubscriber.cs | 0 .../Logging/AbstractLogger.cs | 0 .../Logging/ActionLogger.cs | 0 .../Logging/ILogger.cs | 0 .../Logging/Log.cs | 0 .../Logging/LogEntry.cs | 0 .../Logging/ValueLogger.cs | 0 Class/Utilities.cs => Utilities.cs | 0 21 files changed, 43 insertions(+), 2 deletions(-) rename {Class => Classes}/ICard.cs (100%) rename {Class => Classes}/IDeck.cs (89%) create mode 100644 Classes/ISpread.cs rename {Class => Classes}/TarotCard.cs (100%) rename {Class => Classes}/TarotDeck.cs (100%) create mode 100644 Classes/TarotSpread.cs rename {Class/MenuCLI => MenuCLI}/FuncEntry.cs (100%) rename {Class/MenuCLI => MenuCLI}/IMenu.cs (100%) rename {Class/MenuCLI => MenuCLI}/IMenuEntry.cs (100%) rename {Class/MenuCLI => MenuCLI}/MenuEntry.cs (100%) rename {Class/MenuCLI => MenuCLI}/MenuList.cs (100%) rename Class/Options.cs => Options.cs (100%) rename {Class/Subscription => Subscription}/ISubscribable.cs (100%) rename {Class/Subscription => Subscription}/ISubscriber.cs (100%) rename {Class/Subscription => Subscription}/Logging/AbstractLogger.cs (100%) rename {Class/Subscription => Subscription}/Logging/ActionLogger.cs (100%) rename {Class/Subscription => Subscription}/Logging/ILogger.cs (100%) rename {Class/Subscription => Subscription}/Logging/Log.cs (100%) rename {Class/Subscription => Subscription}/Logging/LogEntry.cs (100%) rename {Class/Subscription => Subscription}/Logging/ValueLogger.cs (100%) rename Class/Utilities.cs => Utilities.cs (100%) diff --git a/Class/ICard.cs b/Classes/ICard.cs similarity index 100% rename from Class/ICard.cs rename to Classes/ICard.cs diff --git a/Class/IDeck.cs b/Classes/IDeck.cs similarity index 89% rename from Class/IDeck.cs rename to Classes/IDeck.cs index 2a5a7f7..e6be8c6 100644 --- a/Class/IDeck.cs +++ b/Classes/IDeck.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace tarot{ public interface IDeck where T : ICard{ public void DeserializeDeck(string filePath); diff --git a/Classes/ISpread.cs b/Classes/ISpread.cs new file mode 100644 index 0000000..b9421f7 --- /dev/null +++ b/Classes/ISpread.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; + +namespace tarot{ + public interface ISpread where T : ICard{ + public void AddCards(IEnumerable cards); + + public string SerializeSpread(); + + public void PrintSpread(); + + public int Size(); + } +} \ No newline at end of file diff --git a/Class/TarotCard.cs b/Classes/TarotCard.cs similarity index 100% rename from Class/TarotCard.cs rename to Classes/TarotCard.cs diff --git a/Class/TarotDeck.cs b/Classes/TarotDeck.cs similarity index 100% rename from Class/TarotDeck.cs rename to Classes/TarotDeck.cs diff --git a/Classes/TarotSpread.cs b/Classes/TarotSpread.cs new file mode 100644 index 0000000..4019ee7 --- /dev/null +++ b/Classes/TarotSpread.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +namespace tarot{ + public class TarotSpread : ISpread{ + private List _spread; + + public TarotSpread(){ + this._spread = new List(); + } + + public void AddCards(IEnumerable cards){ + this._spread.AddRange(cards); + } + + public string SerializeSpread(){ + return Utilities.Serialize>(this._spread); + } + + public void PrintSpread(){ + foreach(TarotCard card in this._spread){ + Console.WriteLine(card.ToString()); + } + } + + public int Size(){ + return _spread.Count; + } + } +} \ No newline at end of file diff --git a/Class/MenuCLI/FuncEntry.cs b/MenuCLI/FuncEntry.cs similarity index 100% rename from Class/MenuCLI/FuncEntry.cs rename to MenuCLI/FuncEntry.cs diff --git a/Class/MenuCLI/IMenu.cs b/MenuCLI/IMenu.cs similarity index 100% rename from Class/MenuCLI/IMenu.cs rename to MenuCLI/IMenu.cs diff --git a/Class/MenuCLI/IMenuEntry.cs b/MenuCLI/IMenuEntry.cs similarity index 100% rename from Class/MenuCLI/IMenuEntry.cs rename to MenuCLI/IMenuEntry.cs diff --git a/Class/MenuCLI/MenuEntry.cs b/MenuCLI/MenuEntry.cs similarity index 100% rename from Class/MenuCLI/MenuEntry.cs rename to MenuCLI/MenuEntry.cs diff --git a/Class/MenuCLI/MenuList.cs b/MenuCLI/MenuList.cs similarity index 100% rename from Class/MenuCLI/MenuList.cs rename to MenuCLI/MenuList.cs diff --git a/Class/Options.cs b/Options.cs similarity index 100% rename from Class/Options.cs rename to Options.cs diff --git a/Class/Subscription/ISubscribable.cs b/Subscription/ISubscribable.cs similarity index 100% rename from Class/Subscription/ISubscribable.cs rename to Subscription/ISubscribable.cs diff --git a/Class/Subscription/ISubscriber.cs b/Subscription/ISubscriber.cs similarity index 100% rename from Class/Subscription/ISubscriber.cs rename to Subscription/ISubscriber.cs diff --git a/Class/Subscription/Logging/AbstractLogger.cs b/Subscription/Logging/AbstractLogger.cs similarity index 100% rename from Class/Subscription/Logging/AbstractLogger.cs rename to Subscription/Logging/AbstractLogger.cs diff --git a/Class/Subscription/Logging/ActionLogger.cs b/Subscription/Logging/ActionLogger.cs similarity index 100% rename from Class/Subscription/Logging/ActionLogger.cs rename to Subscription/Logging/ActionLogger.cs diff --git a/Class/Subscription/Logging/ILogger.cs b/Subscription/Logging/ILogger.cs similarity index 100% rename from Class/Subscription/Logging/ILogger.cs rename to Subscription/Logging/ILogger.cs diff --git a/Class/Subscription/Logging/Log.cs b/Subscription/Logging/Log.cs similarity index 100% rename from Class/Subscription/Logging/Log.cs rename to Subscription/Logging/Log.cs diff --git a/Class/Subscription/Logging/LogEntry.cs b/Subscription/Logging/LogEntry.cs similarity index 100% rename from Class/Subscription/Logging/LogEntry.cs rename to Subscription/Logging/LogEntry.cs diff --git a/Class/Subscription/Logging/ValueLogger.cs b/Subscription/Logging/ValueLogger.cs similarity index 100% rename from Class/Subscription/Logging/ValueLogger.cs rename to Subscription/Logging/ValueLogger.cs diff --git a/Class/Utilities.cs b/Utilities.cs similarity index 100% rename from Class/Utilities.cs rename to Utilities.cs