From f513c694d83ed0f709ae4820b7165f07426e52e8 Mon Sep 17 00:00:00 2001 From: Alecio Furanze Date: Fri, 17 May 2024 17:14:29 +0200 Subject: [PATCH] rename vault to primitive --- src/src/interfance/IPrimitive.cs | 10 ++++++++++ .../{IVaultAdd.cs => IPrimitiveAdd.cs} | 2 +- .../{IVaultGet.cs => IPrimitiveGet.cs} | 2 +- .../{IVaultPrefix.cs => IPrimitivePrefix.cs} | 2 +- src/src/interfance/IVault.cs | 10 ---------- src/src/partials/{Vault.cs => Primitive.cs} | 20 +++++++++---------- .../partials/{VaultAdd.cs => PrimitiveAdd.cs} | 10 +++++----- .../partials/{VaultGet.cs => PrimitiveGet.cs} | 10 +++++----- .../{VaultPrefix.cs => PrimitivePrefix.cs} | 4 ++-- 9 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 src/src/interfance/IPrimitive.cs rename src/src/interfance/{IVaultAdd.cs => IPrimitiveAdd.cs} (96%) rename src/src/interfance/{IVaultGet.cs => IPrimitiveGet.cs} (95%) rename src/src/interfance/{IVaultPrefix.cs => IPrimitivePrefix.cs} (95%) delete mode 100644 src/src/interfance/IVault.cs rename src/src/partials/{Vault.cs => Primitive.cs} (51%) rename src/src/partials/{VaultAdd.cs => PrimitiveAdd.cs} (92%) rename src/src/partials/{VaultGet.cs => PrimitiveGet.cs} (92%) rename src/src/partials/{VaultPrefix.cs => PrimitivePrefix.cs} (91%) diff --git a/src/src/interfance/IPrimitive.cs b/src/src/interfance/IPrimitive.cs new file mode 100644 index 0000000..f4a8985 --- /dev/null +++ b/src/src/interfance/IPrimitive.cs @@ -0,0 +1,10 @@ +namespace Byter +{ + public interface IPrimitive + { + bool IsValid { get; } + byte[] Data { get; } + IPrimitiveAdd Add { get; } + IPrimitiveGet Get { get; } + } +} \ No newline at end of file diff --git a/src/src/interfance/IVaultAdd.cs b/src/src/interfance/IPrimitiveAdd.cs similarity index 96% rename from src/src/interfance/IVaultAdd.cs rename to src/src/interfance/IPrimitiveAdd.cs index cbe9ce4..534a62e 100644 --- a/src/src/interfance/IVaultAdd.cs +++ b/src/src/interfance/IPrimitiveAdd.cs @@ -4,7 +4,7 @@ namespace Byter { - public interface IVaultAdd + public interface IPrimitiveAdd { // 1 byte (3) void Bool(bool value); diff --git a/src/src/interfance/IVaultGet.cs b/src/src/interfance/IPrimitiveGet.cs similarity index 95% rename from src/src/interfance/IVaultGet.cs rename to src/src/interfance/IPrimitiveGet.cs index e4f1973..c172cfc 100644 --- a/src/src/interfance/IVaultGet.cs +++ b/src/src/interfance/IPrimitiveGet.cs @@ -4,7 +4,7 @@ namespace Byter { - public interface IVaultGet + public interface IPrimitiveGet { // 1 byte (3) bool Bool(); diff --git a/src/src/interfance/IVaultPrefix.cs b/src/src/interfance/IPrimitivePrefix.cs similarity index 95% rename from src/src/interfance/IVaultPrefix.cs rename to src/src/interfance/IPrimitivePrefix.cs index 6010828..825e575 100644 --- a/src/src/interfance/IVaultPrefix.cs +++ b/src/src/interfance/IPrimitivePrefix.cs @@ -1,6 +1,6 @@ namespace Byter { - internal interface IVaultPrefix + internal interface IPrimitivePrefix { // 1 byte (3) byte Bool { get; } diff --git a/src/src/interfance/IVault.cs b/src/src/interfance/IVault.cs deleted file mode 100644 index 9c11afc..0000000 --- a/src/src/interfance/IVault.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Byter -{ - public interface IVault - { - bool IsValid { get; } - byte[] Data { get; } - IVaultAdd Add { get; } - IVaultGet Get { get; } - } -} \ No newline at end of file diff --git a/src/src/partials/Vault.cs b/src/src/partials/Primitive.cs similarity index 51% rename from src/src/partials/Vault.cs rename to src/src/partials/Primitive.cs index ab3ec96..5d2cf3d 100644 --- a/src/src/partials/Vault.cs +++ b/src/src/partials/Primitive.cs @@ -2,28 +2,28 @@ namespace Byter { - public partial class Vault : IVault + public partial class Primitive : IPrimitive { - private static readonly IVaultPrefix Prefix; + private static readonly IPrimitivePrefix Prefix; private readonly List _bytes; public bool IsValid { get; } public byte[] Data => _bytes.ToArray(); - public IVaultAdd Add { get; } - public IVaultGet Get { get; } + public IPrimitiveAdd Add { get; } + public IPrimitiveGet Get { get; } - static Vault() + static Primitive() { - Prefix = new VaultPrefix(); + Prefix = new PrimitivePrefix(); } - public Vault() : this(null) + public Primitive() : this(null) { } - public Vault(byte[] data) + public Primitive(byte[] data) { - Get = new VaultGet(this); - Add = new VaultAdd(this); + Get = new PrimitiveGet(this); + Add = new PrimitiveAdd(this); IsValid = false; diff --git a/src/src/partials/VaultAdd.cs b/src/src/partials/PrimitiveAdd.cs similarity index 92% rename from src/src/partials/VaultAdd.cs rename to src/src/partials/PrimitiveAdd.cs index 26f176d..df9e0d4 100644 --- a/src/src/partials/VaultAdd.cs +++ b/src/src/partials/PrimitiveAdd.cs @@ -4,14 +4,14 @@ namespace Byter { - public partial class Vault + public partial class Primitive { - private class VaultAdd : IVaultAdd + private class PrimitiveAdd : IPrimitiveAdd { - private Vault _vault; - public VaultAdd(Vault vault) + private Primitive _primitive; + public PrimitiveAdd(Primitive primitive) { - _vault = vault; + _primitive = primitive; } public void Bool(bool value) diff --git a/src/src/partials/VaultGet.cs b/src/src/partials/PrimitiveGet.cs similarity index 92% rename from src/src/partials/VaultGet.cs rename to src/src/partials/PrimitiveGet.cs index e551ad7..dd35173 100644 --- a/src/src/partials/VaultGet.cs +++ b/src/src/partials/PrimitiveGet.cs @@ -4,14 +4,14 @@ namespace Byter { - public partial class Vault + public partial class Primitive { - private class VaultGet : IVaultGet + private class PrimitiveGet : IPrimitiveGet { - private Vault _vault; - public VaultGet(Vault vault) + private Primitive _primitive; + public PrimitiveGet(Primitive primitive) { - _vault = vault; + _primitive = primitive; } public bool Bool() diff --git a/src/src/partials/VaultPrefix.cs b/src/src/partials/PrimitivePrefix.cs similarity index 91% rename from src/src/partials/VaultPrefix.cs rename to src/src/partials/PrimitivePrefix.cs index 8e5eca9..5976c35 100644 --- a/src/src/partials/VaultPrefix.cs +++ b/src/src/partials/PrimitivePrefix.cs @@ -1,8 +1,8 @@ namespace Byter { - public partial class Vault + public partial class Primitive { - private sealed class VaultPrefix : IVaultPrefix + private sealed class PrimitivePrefix : IPrimitivePrefix { public byte Bool { get; } = 247; public byte Byte { get; } = 237;