示例#1
0
        private static CollisionBag StartNew(byte car1, byte car2)
        {
            var now = DateTime.Now;
            var bag = new CollisionBag()
            {
                BagId = ++_sBagCounter,
                CarsInCollisionTree = new List<byte>(),
                Started = now,
                LastCollision = now,
                IsActive = true,
            };

            bag.CarsInCollisionTree.Add(car1);
            bag.CarsInCollisionTree.Add(car2);

            return bag;
        }
示例#2
0
        private void EvaluateContactTree(CollisionBag bag)
        {
            lock (contactTrees)
                contactTrees.Remove(bag);

            DriverInfo driverInfo = null;
            if (!PluginManager.TryGetDriverInfo(Convert.ToByte(bag.First), out driverInfo))
                return;

            if (driverInfo != null)
            {
                SendDistance(driverInfo, true);
                HandleClientActions(LiveDataServer.CollisionTreeEndedV2(CurrentSessionGuid, bag.First, bag.Second, bag.Count, bag.Started, bag.LastCollision));
            }
        }