void Awake()
 {
     magicInterface = transform.parent.GetComponent <MagicInterface>();
     foreach (Transform child in transform)
     {
         texts.Add(child.GetComponent <Text>());
     }
 }
Exemple #2
0
        static DataTable CreateRunningScoresFile(int totalNumberOfPairs, Boolean debug = false)
        {
            string outputFileName;
            String eventFolder, boardsOutputFolder, boardResultText;
            NameValueCollection pairNames;
            bool hasNewResults;
            int  boardNumber;

            MagicInterface magicInterface = new MagicInterface(configParameters["InputFolder"], configParameters["RunningScoreFileName"],
                                                               configParameters["RunningScoresRoot"], configParameters["BoardResultFont"], Convert.ToBoolean(configParameters["BoardResultFontBold"]));
            DataTable runningScores = magicInterface.GetRunningScores(totalNumberOfPairs / 2, out roundInProgress, out pairNames);

            if (roundInProgress > 0)
            {
                GenerateRunningScoresHTML(runningScores, roundInProgress);

                eventFolder = String.Format(@"{0}\runningscores\{1}", configParameters["OutputFolder"], configParameters["RunningScoresRoot"]);
                if (!Directory.Exists(eventFolder))
                {
                    Directory.CreateDirectory(eventFolder);
                }

                boardsOutputFolder = String.Format(@"{0}\round{1}", eventFolder, roundInProgress.ToString());

                if (!Directory.Exists(boardsOutputFolder))
                {
                    Directory.CreateDirectory(boardsOutputFolder);
                }

                for (int i = 1; i <= numberOfBoardsPerRound; i++)
                {
                    boardNumber = i + (roundInProgress - 1) * numberOfBoardsPerRound;

                    boardResultText = magicInterface.GetBoardResults(i, pairNames, totalNumberOfPairs / 2,
                                                                     roundInProgress, numberOfBoardsPerRound, out hasNewResults);

                    // only update the file if results have been updated
                    if (hasNewResults)
                    {
                        outputFileName = String.Format(@"{0}\board-{1}.html", boardsOutputFolder, boardNumber.ToString());
                        Utility.WriteFile(outputFileName, boardResultText);
                    }
                }
            }

            return(runningScores);
        }
Exemple #3
0
    public void AddButtonSpell(SpellData spell)
    {
        if (!magicInterface)
        {
            magicInterface = transform.parent.GetComponent <MagicInterface>();
        }

        ButtonForInventory button = Instantiate(magicInterface.ButtonPrefab);

        button.transform.SetParent(content);
        button.ChangeText(spell.SpellName);

        if (magicInterface.FavoriteSpells.Contains(spell))
        {
            button.ChangeTextColor(magicInterface.ColorOfFavorite);
        }

        button.button.onClick.AddListener(delegate { magicInterface.DisplaySpellCharacteristics(spell); });

        if (magicInterface.Player.Arsenal.HasSpell(spell) != -1)
        {
            button.DisplayImageEquipped();
        }
    }
Exemple #4
0
 void Awake()
 {
     magicInterface = transform.parent.GetComponent <MagicInterface>();
 }
Exemple #5
0
    void Awake()
    {
        costText = costLabel.text;

        magicInterface = transform.parent.GetComponent <MagicInterface>();
    }