public void IncTimeAtBoogie(DebugData debugData, double time) { if (debugData != null) { debugData.TimeAtBoogie += time; } }
private static void IncCallsToBoogie(DebugData debugData) { if (debugData != null) { debugData.CallsToBoogie++; } }
private static void IncCallsToDafny(DebugData debugData) { if (debugData != null) { debugData.CallsToDafny++; } }
private static void IncVerificationSuccess(DebugData debugData) { if (debugData != null) { debugData.VerificationSucc++; } }
private static void IncVerificationFailure(DebugData debugData) { if (debugData != null) { debugData.VerificationFailure++; } }
public void IncTotalBranchCount(DebugData debugData) { if (debugData != null) { debugData.TotalBranchCount++; } }
private static void IncTimeAtDafny(DebugData debugData, double time) { if (debugData != null) { debugData.TimeAtDafny += time; } }
private void SetupDebugData() { var c = DebugData.GetDebugCharacter(); var guys = new List <Character>() { c }; var cost = new List <int>() { 3 }; ShowRecruits(guys, cost); Manpower = 20; Requisition = 20; List <Item> items = new List <Item>(); List <int> itemCosts = new List <int>(); for (int i = 0; i < 5; i++) { items.Add(DebugData.GetProvisions()); itemCosts.Add(1); } items.Add(new Item("Longsword")); itemCosts.Add(4); ShowItems(items, itemCosts); }
public void DebugAttackArmorTest() { var DM = DungeonMaster.GetDebugDM(data); var attack = DebugData.GetDebugAttackAction(); var robby = DM.Characters[0]; var zach = DM.Characters[1]; zach.Conditions.Add(new Condition("Dodging", 3)); var outcome = new Outcome(); DM.Activate(robby); attack.ResolveAction(DM, robby, null, zach, "", outcome); //not adjacent so nothing happens Assert.IsTrue(zach.Vitality.Value == zach.Vitality.Max); zach.Pos = robby.Pos + Map.DirectionToPosition[Map.Direction.E]; Deck.SetFate(new List <string>() { "Glancing Blow" }); attack.ResolveAction(DM, robby, null, zach, "", outcome); Assert.IsTrue(zach.Vitality.Value < zach.Vitality.Max); Assert.AreEqual(zach.Vitality.Max - robby.Strength.Value - robby.WeaponDamage + zach.ArmorProtection, zach.Vitality.Value); }
public void DebugAttackDeckTest() { var DM = DungeonMaster.GetDebugDM(data); var attack = DebugData.GetDebugAttackAction(); var robby = DM.Characters[0]; var zach = DM.Characters[1]; var deck = attack.GetDeckFor(DM, robby, null, zach); Assert.AreEqual(robby.Profeciency.Value + robby.WeaponAdvantage - zach.ArmorCoverage, deck.Cards.Count(c => c.TypeOfCard == Card.CardType.Hit)); Assert.AreEqual(zach.ArmorCoverage, deck.Cards.Count(c => c.TypeOfCard == Card.CardType.Armor)); Assert.AreEqual(2, deck.Cards.Count(c => c.TypeOfCard == Card.CardType.Miss)); int dodgeCards = 3; zach.Conditions.Add(new Condition("Dodging", dodgeCards)); deck = attack.GetDeckFor(DM, robby, null, zach); Assert.AreEqual(robby.Profeciency.Value + robby.WeaponAdvantage - zach.ArmorCoverage, deck.Cards.Count(c => c.TypeOfCard == Card.CardType.Hit)); Assert.AreEqual(zach.ArmorCoverage, deck.Cards.Count(c => c.TypeOfCard == Card.CardType.Armor)); Assert.AreEqual(2 + dodgeCards, deck.Cards.Count(c => c.TypeOfCard == Card.CardType.Miss)); }
public DebugData CreateData() { var data = new DebugData(); m_DatasBuffer.Enqueue(data); return(data); }
public static new Add ReadFrom(System.IO.BinaryReader reader) { DebugData debugData = Model.DebugData.ReadFrom(reader); var result = new Add(debugData); return(result); }
public void Add(DebugData debugData) { string expandKey = debugData.ID; string foldKey = debugData.StackTrace + debugData.Condition; dicExpandAllData.Add(expandKey, debugData); if (!dicFoldAllData.ContainsKey(foldKey)) { DebugData newData = new DebugData(); newData.Condition = debugData.Condition; newData.Count = 1; newData.StackTrace = debugData.StackTrace; newData.Tiem = debugData.Tiem; newData.Type = debugData.Type; dicFoldAllData.Add(foldKey, newData); } else { dicFoldAllData[foldKey].Count++; } switch (collapseState) { case CollapseState.Fold: AddCurrentData(foldKey, debugData); break; case CollapseState.Expand: AddCurrentData(expandKey, debugData); break; } UpdataDebugCount(); }
public static void Tick() { if (m_WaitingList.Count > 0) { lock (s_Lock) { for (int i = 0; i < m_WaitingList.Count; i++) { DebugData data = m_WaitingList[i]; switch (data.type) { case LogType.Log: DebugLog(data.channel, data.message); break; case LogType.Warning: Warning(data.channel, data.message); break; case LogType.Error: Error(data.channel, data.message); break; } } m_WaitingList.Clear(); } } }
public static DebugData AddLine(GameObject source, string debugString, Color color, KeyCode drawKeyCode = KeyCode.F15, int size = 14, bool isAttachedToObject = false) { //Check if is debug build else do nothing if (!Debug.isDebugBuild) { return(null); } if (instance == null || instance.Equals(null)) { instance = new GameObject("DebugHelper").AddComponent <DebugHelper>(); instance.tag = "DebugHelper"; } DebugData data = new DebugData(debugString, source, color, size, drawKeyCode); if (!isAttachedToObject) { debugDataSet.Add(data); } else { dynamicDebugDataSet.Add(data); } return(data); }
private static void IncGoodBranchCount(DebugData debugData) { if (debugData != null) { debugData.GoodBranchCount++; } }
public void WolfEncounterTest() { var TM = new TravelMaster(); var wolves = DebugData.GetMistWolfEncounter(); TM.ChooseOption(wolves, 0); }
public static void Init() { debugDataDic.Clear(); //1.遍历运行程序集下的所有类 Type[] types = Assembly.GetExecutingAssembly().GetTypes(); //2.看是否包含这个特性,如果有就获取了这个类型 foreach (var type in types) { if (type.IsDefined(typeof(CheatableAttribute), false)) { PropertyInfo[] propertyinfos = type.GetProperties(); foreach (var item in propertyinfos) { if (item.IsDefined(typeof(CheatableAttribute))) { if (item.PropertyType.IsSubclassOf(typeof(PlayerPrefsData))) { string displayName = item.GetCustomAttribute <CheatableAttribute>().displayName; DebugData debugData = new DebugData(displayName, item.GetValue(null)); debugDataDic.Add(displayName, debugData); } } } } } }
private static void InternalSafeLog(LogType type, LOG_CHANNEL channel, string message) { lock (s_Lock) { DebugData data = new DebugData(channel, message, type); m_WaitingList.Add(data); } }
private void SetDebugData(DebugData data) { debugData = data; if (debugGizmo != null) { debugGizmo.DebugData = data; } }
private MessageMetadata BuildMessageMetadata() { var debugData = new DebugData("example-test", "1.0.0"); return(new MessageMetadata(Guid.NewGuid().ToString(), debugData) { AccountId = _accountId }); }
internal InteractiveGenerationContext(List <Segment> segments, Quadtree quadtree, DebugData debugData, PriorityQueue <Segment, int> priorityQueue) { this.segments = segments; this.quadtree = quadtree; this.debugData = debugData; this.priorityQueue = priorityQueue; globalDerivationStep = 0; ended = false; }
protected override void OnMainControllerAwaken() { if (DebugData.TestResult) { DebugData.TestSetResults(); } SetResults(); }
public void BecomeStoneTest() { var guy = DebugData.GetDebugCharacter(); var becomeStone = data.GiveAction("Become Stone", guy); Outcome outcome = new Outcome(); becomeStone.ResolveAction(null, guy, null, null, null, outcome); Assert.IsTrue(guy.ArmorCoverage > 5); }
void ReadData() { try { // Console.WriteLine("Start Read data timer value=" + DiagnosticClass._timer.ElapsedMilliseconds); // _bf = new BinaryFormatter(); _ms = new MemoryStream(); byte[] headerBuffer = new byte[headerSize]; // Console.WriteLine("Before First read Stream value=" + DiagnosticClass._timer.ElapsedMilliseconds); _stream.Read(headerBuffer, 0, headerBuffer.Length); string header = Encoding.Default.GetString(headerBuffer); Console.WriteLine(header); int bufferLenght = int.Parse(header); // Console.WriteLine(bufferLenght); byte[] dataBuffer = new byte[bufferLenght]; // Console.WriteLine("Before second read Stream value=" + DiagnosticClass._timer.ElapsedMilliseconds); _stream.Read(dataBuffer, 0, dataBuffer.Length); // _totalSize = headerSize + dataBuffer.Length; //foreach (byte b in dataBuffer) { // Console.WriteLine(b); //} // Console.WriteLine("Befor Write Stream value=" + DiagnosticClass._timer.ElapsedMilliseconds); _ms.Write(dataBuffer, 0, dataBuffer.Length); _ms.Position = 0; // Object obj = _bf.Deserialize(_ms);// as TankData; // Message msg= Serializer.Deserialize<Message>(_ms); Console.WriteLine(_ms.Length); // Console.WriteLine("Before Serialize Message timer value=" + DiagnosticClass._timer.ElapsedMilliseconds); BinaryFormatter bf = new BinaryFormatter(); bf.Binder = new CustomizedBinder(); // bf.Deserialize(_ms); var dData = new DebugData(); dData = bf.Deserialize(_ms) as DebugData; Console.WriteLine(dData.logString); Console.WriteLine(dData.type); // _message = Serializer.Deserialize<Message>(_ms); // Console.WriteLine(_message._methodParameters._types[1]); // Console.WriteLine("After Serialize Message timer value=" + DiagnosticClass._timer.ElapsedMilliseconds); // ManageMessage(_message); // _tankData = _bf.Deserialize(_ms) as TankData; // byte[] dataBuffer = new byte[128]; // _stream.Read(dataBuffer,0,128); _ms.Close(); // Console.WriteLine(msg._messageType); //Console.WriteLine("x={0}, y={1}, z={2}, str={3}",_tankData.x,_tankData.y,_tankData.z,_tankData.a); //Console.WriteLine("MessageType={0}, ID={1}, MethodName={2}, TankPosX={3}", _message._messageType, // _message._Id, // _message._methodName, // _message._methodParameters._tankParams.x); // SendData(); } catch (Exception e) { Console.WriteLine(e); } }
public void ActionSerializationTest() { var action = DebugData.GetDebugAttackAction(); string json = JsonConvert.SerializeObject(action); var action2 = JsonConvert.DeserializeObject <Action>(json); Assert.AreEqual(action.Name, action2.Name); Assert.AreEqual(action.Cost.Count, action2.Cost.Count); Assert.AreEqual(action.DeckRecipe.Count, action2.DeckRecipe.Count); }
public void RoundTripSerializationTest() { var char1 = DebugData.GetDebugCharacter(); string json = JsonConvert.SerializeObject(char1); var char2 = JsonConvert.DeserializeObject <Character>(json); Assert.AreEqual(char1.Name, char2.Name); Assert.AreEqual(char1.Vitality.Value, char2.Vitality.Value); }
private void OnDebugDataCollected(DebugData debugData) { SetVelocityDataLabels(debugData.Car.Velocity); SetEngineDataLabels(debugData.Car.Engine); SetAeroDataLabels(debugData.Car.Aero); SetTyreDataLabels(_leftFrontTyre, debugData.Car.LeftFrontTyre); SetTyreDataLabels(_rightFrontTyre, debugData.Car.RightFrontTyre); SetTyreDataLabels(_leftRearTyre, debugData.Car.LeftRearTyre); SetTyreDataLabels(_rightRearTyre, debugData.Car.RightRearTyre); }
public void PrintDebugData(DebugData debugData, bool isCsv = false) { if (isCsv) { debugData.PrintCsvDebugData(true); } else { debugData.PrintDebugData(); } }
private void debugDataDelete(object sender, RoutedEventArgs e) { try { Button button = (Button)sender; DebugData data = (DebugData)button.Tag; debugData.Remove(data); } catch (Exception ex) { } }
public static int AddMessage(DebugData Msg) { DebugContainer.Add(Msg); CleanLockedDebugMessages(); return DebugContainer.Count - 1; }