Exemplo n.º 1
0
        public void Address(object sender, Tryte address)
        {
            int addr = address.ToInt();

            if (addr < 0)
            {
                throw new IndexOutOfRangeException();
            }
            else if (addr < TRIBBLE_SIZE)
            {
                trortRegister = null;
                tryteRegister.ReadWriteEnabled(this, Trit.Neu);
                tryteRegister = _TryteRegisters[addr];
                tryteRegister.ReadWriteEnabled(this, rwEnabledState);
            }
            else if (addr < TRIBBLE_SIZE * 2)
            {
                tryteRegister = null;
                trortRegister.ReadWriteEnabled(this, Trit.Neu);
                trortRegister = _TrortRegisters[addr];
                trortRegister.ReadWriteEnabled(this, rwEnabledState);
            }
        }
Exemplo n.º 2
0
        public TernaryString Substring(Tryte index, Tryte length)
        {
            int len = length.ToInt();

            return(new TernaryString(_Chars.Skip(index.ToInt()).Take(len)));
        }
Exemplo n.º 3
0
 public TernaryString Substring(Tryte index)
 {
     return(new TernaryString(_Chars.Skip(index.ToInt())));
 }