Exemplo n.º 1
0
        private void DisplayMaze()
        {
            String output = "";

            Tile head = Maze.Head;

            Tile currentTile = head;

            while (head != null)
            {
                while (currentTile != null)
                {
                    output     += currentTile.Description;
                    currentTile = currentTile.East;
                }

                output     += "\n";
                head        = head.South;
                currentTile = head;
            }

            OutputView.DisplayMaze(output);
        }
Exemplo n.º 2
0
        private void ShowMaze()
        {
            string[] values = new string[maze.FieldDoublyDoublyLinkedList.RowFirst.Length];
            for (int i = 0; i < values.Length; i++)
            {
                FieldDoublyDoublyLink item = new FieldDoublyDoublyLink();
                item = maze.FieldDoublyDoublyLinkedList.RowFirst[i];

                while (item != null)
                {
                    switch (item.Floor.Type)
                    {
                    case "floor":
                        if (item.Floor.Truck != null)
                        {
                            values[i] += '@';
                        }
                        else if (item.Floor.Chest != null)
                        {
                            values[i] += 'O';
                        }
                        else if (item.Floor.Employee != null)
                        {
                            values[i] += item.Floor.Employee.Type;
                        }
                        else
                        {
                            values[i] += '.';
                        }
                        break;

                    case "destination":
                        if (item.Floor.Truck != null)
                        {
                            values[i] += '@';
                        }
                        else if (item.Floor.Chest != null)
                        {
                            values[i] += '0';
                        }
                        else if (item.Floor.Employee != null)
                        {
                            values[i] += item.Floor.Employee.Type;
                        }
                        else
                        {
                            values[i] += 'X';
                        }
                        break;

                    case "wall":
                        values[i] += '█';
                        break;

                    case "freefall":
                        if (item.Floor.Truck != null)
                        {
                            values[i] += '@';
                        }
                        else if (item.Floor.Chest != null)
                        {
                            values[i] += 'O';
                        }
                        else if (item.Floor.Employee != null)
                        {
                            values[i] += item.Floor.Employee.Type;
                        }
                        else
                        {
                            values[i] += ' ';
                        }
                        break;

                    case "pitfall":
                        if (item.Floor.Truck != null)
                        {
                            values[i] += '@';
                        }
                        else if (item.Floor.Chest != null)
                        {
                            values[i] += 'O';
                        }
                        else if (item.Floor.Employee != null)
                        {
                            values[i] += item.Floor.Employee.Type;
                        }
                        else
                        {
                            values[i] += '~';
                        }
                        break;

                    case "empty":
                        values[i] += ' ';
                        break;

                    default:
                        break;
                    }
                    item = item.Next;
                }
            }
            outputView.DisplayMaze(values);
        }