예제 #1
0
 public BookingDecoder()
 {
     frameCodec   = new FrameCodec(2);
     reverseCodec = new ReverseCodec();
     cezarCodec   = new CezarCodec(-1);
     swapCodec    = new SwapCodec();
 }
예제 #2
0
 public ShutterStockDecoder()
 {
     cezarCodec   = new CezarCodec(4);
     frameCodec   = new FrameCodec(1);
     pushCodec    = new PushCodec(-3);
     reverseCodec = new ReverseCodec();
 }
예제 #3
0
        private BookingCoder()
        {
            Coder = new FrameCodec(2);
            Coder.AddNextInChain(new ReverseCodec())
            .AddNextInChain(new CezarCodec(-1))
            .AddNextInChain(new SwapCodec());

            Decoder = new SwapCodec();
            Decoder.AddNextInChain(new CezarCodec(1))
            .AddNextInChain(new ReverseCodec())
            .AddNextInChain(new FrameDeCodec(2));
        }
예제 #4
0
        private ShutterStockCoder()
        {
            Decoder = new ReverseCodec();
            Decoder.AddNextInChain(new PushCodec(3))
            .AddNextInChain(new FrameDeCodec(1))
            .AddNextInChain(new CezarCodec(-4));


            DecCodec fra = new FrameCodec(1);
            DecCodec rev = new ReverseCodec();
            DecCodec cez = new CezarCodec(4);
            DecCodec pus = new PushCodec(3);

            pus.AddNextInChain(rev);
            fra.AddNextInChain(pus);
            cez.AddNextInChain(fra);


            Coder = cez;
        }
예제 #5
0
 public TripAdvisorDecoder()
 {
     pushCodec  = new PushCodec(3);
     frameCodec = new FrameCodec(2);
     swapCodec  = new SwapCodec();
 }
        public string Decode(string s)
        {
            string str = new FrameCodec(new ReverseCodec(new CesarCodec(new SwapCodec(s).Code(), 1).Code()).Code(), -2).Code();

            return(str);
        }