示例#1
0
文件: World.cs 项目: vogon/Demotic
        public World()
        {
            _scripts = new List<IScript>();
            _stopLoopSource = new CancellationTokenSource();

            GlobalObjectRoot = new DRecord();
            GlobalObjectRoot["test"] = new DNumber(3);
        }
示例#2
0
        public void TestSerializeDNumber()
        {
            DipMessageFormat_Accessor fmt = new DipMessageFormat_Accessor();
            Bencoder_Accessor e = new Bencoder_Accessor();
            DNumber n = new DNumber(123.45m);

            fmt.SerializeDNumber(e, n);
            Utils.AssertBytewiseIdentical(Utils.Bs("Nn123.45ee"), e.Encoded);
        }
示例#3
0
 private void SerializeDNumber(Bencoder e, DNumber n)
 {
     e.StartDNumber().Number(n.Value).FinishDNumber();
 }
示例#4
0
            public override void InsertNumber(decimal dec)
            {
                Debug.Assert(_key != null);
                Debug.Assert(_key is string);

                _rec[(string)_key] = new DNumber(dec);
                _key = null;
            }