private static List<PositionedTask> GetTasks(char[,] artChars, IDictionary<char, TaskNode> nodes)
{
List<PositionedTask> result = new List<PositionedTask>();
for (int x = 0; x < artChars.GetLength(0); x++)
{
for (int y = 0; y < artChars.GetLength(1); y++)
{
if (artChars[x, y] >= 'a' && artChars[x, y] <= 'z')
{
if(nodes.ContainsKey(artChars[x,y]))
{
result.Add(new PositionedTask(){pos = new Position(){x = x, y=y}, task = nodes[artChars[x,y]]});
}else{
throw new InvalidOperationException(String.Format("The flow definition contains the letter '{0}'. No task is known for this letter.", artChars[x,y]));
}
}
}
}
return result;
}