-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
271 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
namespace Byter | ||
{ | ||
public interface IGet | ||
public interface IPotGet | ||
{ | ||
// 1 byte (3) | ||
bool Bool(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Byter | ||
{ | ||
public partial class Pot : IPot | ||
{ | ||
private readonly List<byte> _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<byte>(); | ||
|
||
if (data != null && data.Length > 0) | ||
{ | ||
_bytes.AddRange(data); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<T>(IList<T> value) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public void List<T>(List<T> value) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<T>() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public T Struct<T>() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public IList<T> Array<T>() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public List<T> List<T>() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} | ||
} |