diff --git a/src/src/interfance/IPot.cs b/src/src/interfance/IPot.cs index b344ba8..74f0b81 100644 --- a/src/src/interfance/IPot.cs +++ b/src/src/interfance/IPot.cs @@ -3,9 +3,8 @@ namespace Byter public interface IPot { bool IsValid { get; } - int Count { get; } byte[] Data { get; } - IAdd Add { get; } - IGet Get { get; } + IPotAdd Add { get; } + IPotGet Get { get; } } } \ No newline at end of file diff --git a/src/src/interfance/IAdd.cs b/src/src/interfance/IPotAdd.cs similarity index 96% rename from src/src/interfance/IAdd.cs rename to src/src/interfance/IPotAdd.cs index ce73d9c..25ffcd3 100644 --- a/src/src/interfance/IAdd.cs +++ b/src/src/interfance/IPotAdd.cs @@ -3,7 +3,7 @@ namespace Byter { - public interface IAdd + public interface IPotAdd { // 1 byte (3) void Bool(bool value); diff --git a/src/src/interfance/IGet.cs b/src/src/interfance/IPotGet.cs similarity index 95% rename from src/src/interfance/IGet.cs rename to src/src/interfance/IPotGet.cs index b834d50..da85857 100644 --- a/src/src/interfance/IGet.cs +++ b/src/src/interfance/IPotGet.cs @@ -3,7 +3,7 @@ namespace Byter { - public interface IGet + public interface IPotGet { // 1 byte (3) bool Bool(); diff --git a/src/src/partials/Pot.cs b/src/src/partials/Pot.cs new file mode 100644 index 0000000..d4fbadf --- /dev/null +++ b/src/src/partials/Pot.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; + +namespace Byter +{ + public partial class Pot : IPot + { + private readonly List _bytes; + public bool IsValid { get; } + public byte[] Data => _bytes.ToArray(); + public IPotAdd Add { get; } + public IPotGet Get { get; } + + public Pot() : this(null) + { + } + + public Pot(byte[] data) + { + Get = new PotGet(this); + Add = new PotAdd(this); + + IsValid = false; + + _bytes = new List(); + + if (data != null && data.Length > 0) + { + _bytes.AddRange(data); + } + } + } +} \ No newline at end of file diff --git a/src/src/partials/PotAdd.cs b/src/src/partials/PotAdd.cs new file mode 100644 index 0000000..938e971 --- /dev/null +++ b/src/src/partials/PotAdd.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; + +namespace Byter +{ + public partial class Pot + { + private class PotAdd : IPotAdd + { + private Pot _pot; + public PotAdd(Pot pot) + { + _pot = pot; + } + + public void Bool(bool value) + { + throw new NotImplementedException(); + } + + public void Byte(byte value) + { + throw new NotImplementedException(); + } + + public void SByteInt(sbyte value) + { + throw new NotImplementedException(); + } + + public void Char(char value) + { + throw new NotImplementedException(); + } + + public void Short(short value) + { + throw new NotImplementedException(); + } + + public void UShort(ushort value) + { + throw new NotImplementedException(); + } + + public void Int(int value) + { + throw new NotImplementedException(); + } + + public void UInt(uint value) + { + throw new NotImplementedException(); + } + + public void Float(float value) + { + throw new NotImplementedException(); + } + + public void Enum(Enum value) + { + throw new NotImplementedException(); + } + + public void Long(long value) + { + throw new NotImplementedException(); + } + + public void ULong(ulong value) + { + throw new NotImplementedException(); + } + + public void Double(double value) + { + throw new NotImplementedException(); + } + + public void DateTime(DateTime value) + { + throw new NotImplementedException(); + } + + public void Decimal(decimal value) + { + throw new NotImplementedException(); + } + + public void String(string value) + { + throw new NotImplementedException(); + } + + public void Class(object value) + { + throw new NotImplementedException(); + } + + public void Struct(object value) + { + throw new NotImplementedException(); + } + + public void Array(IList value) + { + throw new NotImplementedException(); + } + + public void List(List value) + { + throw new NotImplementedException(); + } + } + } +} \ No newline at end of file diff --git a/src/src/partials/PotGet.cs b/src/src/partials/PotGet.cs new file mode 100644 index 0000000..99df8c9 --- /dev/null +++ b/src/src/partials/PotGet.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; + +namespace Byter +{ + public partial class Pot + { + private class PotGet : IPotGet + { + private Pot _pot; + public PotGet(Pot pot) + { + _pot = pot; + } + + public bool Bool() + { + throw new NotImplementedException(); + } + + public byte Byte() + { + throw new NotImplementedException(); + } + + public sbyte SByteInt() + { + throw new NotImplementedException(); + } + + public char Char() + { + throw new NotImplementedException(); + } + + public short Short() + { + throw new NotImplementedException(); + } + + public ushort UShort() + { + throw new NotImplementedException(); + } + + public int Int() + { + throw new NotImplementedException(); + } + + public uint UInt() + { + throw new NotImplementedException(); + } + + public float Float() + { + throw new NotImplementedException(); + } + + public Enum Enum() + { + throw new NotImplementedException(); + } + + public long Long() + { + throw new NotImplementedException(); + } + + public ulong ULong() + { + throw new NotImplementedException(); + } + + public double Double() + { + throw new NotImplementedException(); + } + + public DateTime DateTime() + { + throw new NotImplementedException(); + } + + public decimal Decimal() + { + throw new NotImplementedException(); + } + + public string String() + { + throw new NotImplementedException(); + } + + public T Class() + { + throw new NotImplementedException(); + } + + public T Struct() + { + throw new NotImplementedException(); + } + + public IList Array() + { + throw new NotImplementedException(); + } + + public List List() + { + throw new NotImplementedException(); + } + } + } +} \ No newline at end of file