/* public static List<string> getHighScores(Level level)
            {
                List<string> higscores = new List<string>();

            } */
        public static void saveLevel(Level level)
        {
            Filer.saveToFile(level, storageLocation + "xml/Levels/" + level.LevelName);
        }
 public static void publishLevel(Level level)
 {
     // Connector.sendToServer(levels);
 }
 //  private int currentScore;
 public GameInstance(Level level)
 {
     myLevel = level;
 }
        // set a new level
        public void newLevel(Level level)
        {
            // clear the current level
            GameController.CurrentGame.Renderer.clearAll();
            // set level base as the new level
            myLevel = level;
            // set theseus and minotaur location
            theseusLocation = myLevel.TheseusLocation;
            minotaurLocation = myLevel.MinotaurLocation;
            theseusLast = myLevel.TheseusLocation;
            minotaurLast[0] = myLevel.MinotaurLocation;
            minotaurLast[1] = myLevel.MinotaurLocation;

            // build base game board
            buildCells();
            gameState = true;
            canUndo = true;
        }
        private static void loadGameBoard(Level level, object sender, Theseus theseus, Minotaur minotaur)
        {
            int Theseus = level.TheseusLocation;
            int Minotaur = level.MinotaurLocation;
            int Exit = level.ExitLocation;
            int count = 0;

            Button loadButton = sender as Button;
            var theButton = sender as CustomControl_Button;
            Form parentForm = loadButton.FindForm();

            foreach (Cell cell in level.CellCollection)
            {
                theButton = parentForm.Controls.Find(count.ToString(), true).FirstOrDefault() as CustomControl_Button;

                if (Theseus == count)
                {

                    OldTheseusButton = theButton;
                    OldTheseusButton.ChildCharacter = theseus;

                    LevelDesigner.MyLevel.TheseusLocation = LevelDesigner.MyLevel.CellCollection.IndexOf(OldTheseusButton.ChildCell);

                }
                else if (Minotaur == count)
                {
                    OldMinotaurButton = theButton;
                    OldMinotaurButton.ChildCharacter = minotaur;
                    LevelDesigner.MyLevel.MinotaurLocation = LevelDesigner.MyLevel.CellCollection.IndexOf(OldMinotaurButton.ChildCell);

                }
                else if (Exit == count)
                {
                    OldExitButton = theButton;
                    OldExitButton._PreviousCell = theButton.ChildCell;

                    Cell cellll = new Cell() { Type = CellType.Exit };

                    theButton.ChildCell = cellll;

                    LevelDesigner.MyLevel.ExitLocation = LevelDesigner.MyLevel.CellCollection.IndexOf(theButton.ChildCell);

                }

                count++;
            }
                {
            }
        }
 // creates level and adds it to current level
 public static void createLevel(int width, int height)
 {
     _MyLevel = new Level(width, height);
 }