public static void RespondToAPPBreak(string agentFullname, int frame, string behaviorFilename, string nodeId, string actionName, string actionResult, int hitCount) { CheckJump(agentFullname, ref behaviorFilename, ref nodeId); if (behaviorFilename == GetBehaviorFilename(agentFullname, frame)) { behaviorFilename = behaviorFilename.Replace('/', '\\'); DebugDataPool.BreakPoint breakPoint = DebugDataPool.FindBreakPoint(behaviorFilename, nodeId, actionName); if (breakPoint != null && breakPoint.IsActive(actionName, actionResult, hitCount)) { HighlightBreakPoint.Instance = new HighlightBreakPoint(behaviorFilename, nodeId, breakPoint.NodeType, actionName, actionResult); AgentDataPool.BreakFrame = frame; } else { HighlightBreakPoint.Instance = null; AgentDataPool.BreakFrame = -1; } } }
private void removeBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { SendBreakpoint(behaviorFilename, nodeType, nodeId, action.Name, false, 0, "all"); }
private void addBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { if (action.Enable) { SendBreakpoint(behaviorFilename, nodeType, nodeId, action.Name, true, action.HitCount, action.Result); } else { removeBreakPoint(behaviorFilename, nodeType, nodeId, action); } }
private void addBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { if (!_isReady) return; int index = newBreakPoint(behaviorFilename, nodeType, nodeId, action); DataGridViewRow row = dataGridView.Rows[index]; dataGridView.CurrentCell = row.Cells["BehaviorFilename"]; dataGridView.Sort(dataGridView.Columns["BehaviorFilename"], System.ComponentModel.ListSortDirection.Ascending); selectRowNode(row); }
private void removeBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { if (!_isReady) return; int index = getRowIndex(behaviorFilename, nodeId, action.Name); if (index > -1) { dataGridView.Rows.RemoveAt(index); if (dataGridView.CurrentCell != null) { DataGridViewRow row = dataGridView.Rows[dataGridView.CurrentCell.RowIndex]; row.Selected = true; } } }
private int newBreakPoint(string behaviorFilename, string nodeType, string nodeId, DebugDataPool.Action action) { _isReady = false; int index = getRowIndex(behaviorFilename, nodeId, action.Name); if (index < 0) index = dataGridView.Rows.Add(); DataGridViewRow row = dataGridView.Rows[index]; row.Tag = action; row.Cells["Enable"].Value = action.Enable; row.Cells["BehaviorFilename"].Value = behaviorFilename; row.Cells["NodeType"].Value = nodeType; row.Cells["NodeId"].Value = nodeId; row.Cells["ActionName"].Value = action.Name; row.Cells["ActionResult"].Value = action.Result; row.Cells["HitCount"].Value = action.HitCount; _isReady = true; return index; }
private void deleteBreakpoints(string[] behaviorFilenames, string[] nodeIds, DebugDataPool.Action[] actions) { Debug.Check(behaviorFilenames.Length == nodeIds.Length && nodeIds.Length == actions.Length); for (int i = 0; i < behaviorFilenames.Length; i++) { DebugDataPool.RemoveBreakPoint(behaviorFilenames[i], nodeIds[i], actions[i]); } BehaviorTreeViewDock.RefreshAll(); Inspect(); }