private void encodeElement(MemoryStream ms, string name, BSONValue v) {
			switch (v.valueType) {
			case BSONValue.ValueType.Double:
				ms.WriteByte (0x01);
				encodeCString (ms, name);
				encodeDouble (ms, v.doubleValue);
				return;
				case BSONValue.ValueType.String:
				ms.WriteByte (0x02);
				encodeCString (ms, name);
				encodeString (ms, v.stringValue);
				return;
				case BSONValue.ValueType.Object:
				ms.WriteByte (0x03);
				encodeCString (ms, name);
				encodeDocument(ms, v as BSONObject);
				return;
				case BSONValue.ValueType.Array:
				ms.WriteByte (0x04);
				encodeCString (ms, name);
				encodeArray (ms, v as BSONArray);
				return;
				case BSONValue.ValueType.Binary:
				ms.WriteByte (0x05);
				encodeCString (ms, name);
				encodeBinary (ms, v.binaryValue);
				return;
				case BSONValue.ValueType.Boolean:
					ms.WriteByte (0x08);
					encodeCString (ms, name);
					encodeBool (ms, v.boolValue);
				return;
				case BSONValue.ValueType.UTCDateTime:
				ms.WriteByte (0x09);
				encodeCString (ms, name);
				encodeUTCDateTime (ms, v.dateTimeValue);
				return;
				case BSONValue.ValueType.None:
				ms.WriteByte (0x0A);
				encodeCString (ms, name);
				return;
				case BSONValue.ValueType.Int32:
				ms.WriteByte (0x10);
				encodeCString (ms, name);
				encodeInt32 (ms, v.int32Value);
				return;
				case BSONValue.ValueType.Int64:
				ms.WriteByte (0x12);
				encodeCString (ms, name);
				encodeInt64 (ms, v.int32Value);
				return;
			};
		}
Beispiel #2
0
 //
 // Methods
 //
 public override void Add(BSONValue v)
 {
     mList.Add(v);
 }
        protected override void SoundLoadMsg(icSound sound)
        {
            BSONObject b = new BSONObject();
            b["id"] = sound.GetId();
            b["streaming"] = new BSONValue(sound.IsStreaming());
            b["looping"] = new BSONValue(sound.IsLooping());
            b["videosync"] = new BSONValue(sound.IsVideoSync());
            b["permanent"] = new BSONValue(true);
            b["path"] = sound.GetFilePath();
            b["speed"] = sound.PlayRate;
            b["volume"] = sound.Volume;

            b["position"] = WorldToBellowsPosition(sound.GetWorldPosition());

            bsonChildren["load"].Add (b);
        }
Beispiel #4
0
 public virtual bool Contains(BSONValue v)
 {
     return(false);
 }
Beispiel #5
0
 public override bool Contains(BSONValue v)
 {
     return(mMap.ContainsValue(v));
 }
Beispiel #6
0
 public virtual bool Contains(BSONValue v)
 {
     return(mList.Contains(v));
 }
Beispiel #7
0
 public virtual void Add(string key, BSONValue value)
 {
 }
		public override void Add (string key, BSONValue value) {
			mMap.Add (key, value);
		}
		public override bool Contains(BSONValue v) {
			return mMap.ContainsValue (v);
		}
		public virtual void Add (BSONValue value) {}
		public virtual bool Contains(BSONValue v) { return false; }
		public virtual void Add (string key, BSONValue value) {}
Beispiel #13
0
		public virtual bool Contains(BSONValue v) {
			return mList.Contains (v);
		}
Beispiel #14
0
 public override bool Contains(BSONValue v)
 {
     return(mList.Contains(v));
 }
Beispiel #15
0
 public void Insert(int index, BSONValue item)
 {
     mList.Insert(index, item);
 }
		public bool TryGetValue (string key, out BSONValue value) {
			return mMap.TryGetValue (key, out value);
		}
Beispiel #17
0
 public bool Remove(BSONValue v)
 {
     return(mList.Remove(v));
 }
		//
		// Methods
		//
		public override void Add(BSONValue v) {
			mList.Add (v);
		}
Beispiel #19
0
        private void encodeElement(MemoryStream ms, string name, BSONValue v)
        {
            switch (v.valueType)
            {
            case BSONValue.ValueType.Double:
                ms.WriteByte(0x01);
                encodeCString(ms, name);
                encodeDouble(ms, v.doubleValue);
                return;

            case BSONValue.ValueType.String:
                ms.WriteByte(0x02);
                encodeCString(ms, name);
                encodeString(ms, v.stringValue);
                return;

            case BSONValue.ValueType.Object:
                ms.WriteByte(0x03);
                encodeCString(ms, name);
                encodeDocument(ms, v as BSONObject);
                return;

            case BSONValue.ValueType.Array:
                ms.WriteByte(0x04);
                encodeCString(ms, name);
                encodeArray(ms, v as BSONArray);
                return;

            case BSONValue.ValueType.Binary:
                ms.WriteByte(0x05);
                encodeCString(ms, name);
                encodeBinary(ms, v.binaryValue);
                return;

            case BSONValue.ValueType.Boolean:
                ms.WriteByte(0x08);
                encodeCString(ms, name);
                encodeBool(ms, v.boolValue);
                return;

            case BSONValue.ValueType.UTCDateTime:
                ms.WriteByte(0x09);
                encodeCString(ms, name);
                encodeUTCDateTime(ms, v.dateTimeValue);
                return;

            case BSONValue.ValueType.None:
                ms.WriteByte(0x0A);
                encodeCString(ms, name);
                return;

            case BSONValue.ValueType.Int32:
                ms.WriteByte(0x10);
                encodeCString(ms, name);
                encodeInt32(ms, v.int32Value);
                return;

            case BSONValue.ValueType.Int64:
                ms.WriteByte(0x12);
                encodeCString(ms, name);
                encodeInt64(ms, v.int64Value);
                return;
            }
            ;
        }
		public int IndexOf (BSONValue item) {
			return mList.IndexOf (item);
		}
Beispiel #21
0
 public virtual void Add(BSONValue value)
 {
 }
		public void Insert (int index, BSONValue item) {
			mList.Insert (index, item);
		}
Beispiel #23
0
 public override void Add(string key, BSONValue value)
 {
     mMap.Add(key, value);
 }
		public bool Remove(BSONValue v) {
			return mList.Remove (v);
		}
Beispiel #25
0
 public bool TryGetValue(string key, out BSONValue value)
 {
     return(mMap.TryGetValue(key, out value));
 }
		public override bool Contains(BSONValue v) {
			return mList.Contains (v);
		}
Beispiel #27
0
 public int IndexOf(BSONValue item)
 {
     return(mList.IndexOf(item));
 }
        // Called from OnApplicationQuit()
        protected override void QuitMessenger()
        {
            // Send a clearall right before disconnecting
            bsonGlobals["clearall"] = new BSONValue(true);
            bsonRoot["globals"] = bsonGlobals;
            bsonSender.Send(bsonRoot);

            // Disconnection handled by BSONSender destructor
            bsonSender = null;
        }