public void Reset()
 {
     RowFormations.Clear();
     ColumnFormations.Clear();
     AllFormations.Clear();
     AllClearedBlocks.Clear();
 }
        public void AddFormation(Block[] formation, bool isRow)
        {
            // Check which list to add the formation to
            if (isRow == true)
            {
                RowFormations.Add(formation);
            }
            else
            {
                ColumnFormations.Add(formation);
            }

            // Add formation to all formations
            AllFormations.Add(formation);

            // Add each block in formation to all cleared blocks
            foreach (Block block in formation)
            {
                AllClearedBlocks.Add(block);
            }
        }
Exemple #3
0
    IEnumerator LateLoadEverything()
    {
        yield return(new WaitForSeconds(.2f));

        string path = Application.dataPath + "/Formations-Plays.json";

        if (File.Exists(path))
        {
            string json = File.ReadAllText(path);
            allFormations = JsonUtility.FromJson <AllFormations>(json);

            PopulateDropdownDataForFormationsAndPlays();
        }


        string playsHolderPath = Application.dataPath + "/PlaysNamesHolder.json";

        if (File.Exists(playsHolderPath))
        {
            string json = File.ReadAllText(playsHolderPath);
            playsNamesHolder = JsonUtility.FromJson <PlaysNameHolder>(json);
        }
    }
 public void SortLists()
 {
     AllFormations.Sort(SortFormations);
     AllClearedBlocks.Sort(SortBlocks);
 }