void sc_OnRecvSimobjectDataBytype(SimConnect sender, SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE data) { if (!Objects.Contains(data.dwObjectID)) { VehiclePosition pos = (VehiclePosition)data.dwData; pos.ObjectID = data.dwObjectID; AddObject(pos); } }
void AddObject(VehiclePosition pos) { sc.RequestDataOnSimObject( (RequestIDs)((uint)RequestIDs.VehicleDataRequestBase + (uint)pos.ObjectID), pos.ObjectID, SIMCONNECT_PERIOD.VISUAL_FRAME, SIMCONNECT_DATA_REQUEST_FLAG.CHANGED, pos); this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new MyDelegate(delegate() { Objects.Add(pos); })); }
void AddObject(UInt32 eObjectID) { VehiclePosition pos = new VehiclePosition(eObjectID); AddObject(pos); }