private void AddLineMapping(LineType type, GoalDebugInfo goal, NodeDebugInfo node, UInt32 index, UInt32 line) { GoalLineMap goalMap; if (!GoalMap.TryGetValue(goal.Name, out goalMap)) { goalMap = new GoalLineMap { Goal = goal, LineMap = new Dictionary <uint, LineDebugInfo>() }; GoalMap.Add(goal.Name, goalMap); } var mapping = new LineDebugInfo { Type = type, Goal = goal, Node = node, ActionIndex = index, Line = line }; goalMap.LineMap[line] = mapping; }
private void BuildLineMap(GoalDebugInfo goal) { for (var index = 0; index < goal.InitActions.Count; index++) { AddLineMapping(LineType.GoalInitActionLine, goal, null, (UInt32)index, goal.InitActions[index].Line); } for (var index = 0; index < goal.ExitActions.Count; index++) { AddLineMapping(LineType.GoalExitActionLine, goal, null, (UInt32)index, goal.ExitActions[index].Line); } }
private GoalDebugInfo FromProtobuf(GoalDebugInfoMsg msg) { var debugInfo = new GoalDebugInfo { Id = msg.Id, Name = msg.Name, Path = msg.Path, InitActions = new List <ActionDebugInfo>(), ExitActions = new List <ActionDebugInfo>() }; foreach (var action in msg.InitActions) { debugInfo.InitActions.Add(FromProtobuf(action)); } foreach (var action in msg.ExitActions) { debugInfo.ExitActions.Add(FromProtobuf(action)); } return(debugInfo); }
private GoalDebugInfoMsg ToProtobuf(GoalDebugInfo debugInfo) { var msg = new GoalDebugInfoMsg { Id = debugInfo.Id, Name = debugInfo.Name, Path = debugInfo.Path }; foreach (var action in debugInfo.InitActions) { var varAct = ToProtobuf(action); msg.InitActions.Add(varAct); } foreach (var action in debugInfo.ExitActions) { var varAct = ToProtobuf(action); msg.ExitActions.Add(varAct); } return(msg); }