Exemple #1
0
        private IEnumerable <string> GetClosedRealtions(RelationArray array)
        {
            IRelationInterpreter interpreter = new ActualInterpreter();

            for (int i = 0; i < array.Width; i++)
            {
                for (int j = 0; j < array.Height; j++)
                {
                    if (!interpreter.IsOpen(array[i, j]))
                    {
                        yield return(i + "x" + j);
                    }
                }
            }
        }
Exemple #2
0
        private void SaveLabyrinth_Click(object sender, RoutedEventArgs e)
        {
            IRelationInterpreter interpreter = new ActualInterpreter();
            Labyrinth            lab         = lc.Labyrinth;

            string text = lab.Width + "x" + lab.Height + "|";

            text += lab.Target.TopLeft.X + "x" + lab.Target.TopLeft.Y + "|";
            text += string.Join(";", GetClosedRealtions(lab.H)) + "|";
            text += string.Join(";", GetClosedRealtions(lab.V));

            try
            {
                File.WriteAllText("Data.txt", text);
            }
            catch { }
        }