public void GetShifts() { System.Collections.Generic.Dictionary <long, WoMFramework.Game.Interaction.Shift> shifts1 = Blockchain.Instance.GetShifts("MEYUySQDPzgbTuZSjGfPVikgHtDJZHL8WE"); Assert.True(shifts1.Count > 6734); Assert.Equal(4, shifts1.Count(p => !p.Value.IsSmallShift)); //Assert.Equal("", shifts1[2].TxHex); //var shifts2 = Blockchain.Instance.GetShifts("MHULbsPvAVCCbaYm9b5wBuJ79eQPXeGgbF"); //Assert.True(shifts2.Count > 0); }
/// <summary> /// Check the state of the bus response for any alarm conditions. /// </summary> /// <param name="busState">MetroResponse from the KCM api</param> /// <returns>This routine only writes to console</returns> public static void EvaluateAndPrint(MetroResponse busState) { int latFenceN = 47000000; //it has left the staging area and started southbound int latFenceS = 47000000; //too late i missed it foreach (var aBus in busState.result.First().RealTimeResults.ToArray()) { if (latFenceN < aBus.Lat) { if (busInHolding.ContainsKey(aBus.VehicleNumber)) { busInHolding[aBus.VehicleNumber] = new System.Drawing.Point(aBus.Lon, aBus.Lat); } else { busInHolding.Add(aBus.VehicleNumber, new System.Drawing.Point(aBus.Lon, aBus.Lat)); } } else if (latFenceS < aBus.Lat) { if (busInHolding.ContainsKey(aBus.VehicleNumber)) { busInHolding.Remove(aBus.VehicleNumber); } if (busApproaching.ContainsKey(aBus.VehicleNumber)) { busApproaching[aBus.VehicleNumber] = new System.Drawing.Point(aBus.Lon, aBus.Lat); } else { busApproaching.Add(aBus.VehicleNumber, new System.Drawing.Point(aBus.Lon, aBus.Lat)); } } else { if (busInHolding.ContainsKey(aBus.VehicleNumber)) { busInHolding.Remove(aBus.VehicleNumber); } if (busApproaching.ContainsKey(aBus.VehicleNumber)) { busApproaching.Remove(aBus.VehicleNumber); } } } Console.WriteLine($"{busInHolding.Count()} in staging area"); foreach (var x in busApproaching.Keys) { Console.WriteLine($"{x} \t {getDistance(busApproaching[x], new System.Drawing.Point(busApproaching[x].X, latFenceS)) }\t{DateTime.Now}"); } }