Exemple #1
0
    internal void ConvertTextToAnswer()
    {
        Debug.Log("load text is: " + answerText);
        string[] texts = answerText.Split(',');
        Dictionary <int, int> tempAnswers = new Dictionary <int, int>();
        int tempId = 1;

        foreach (string s in texts)
        {
            if (string.IsNullOrEmpty(s.Trim()))
            {
                continue;
            }
            try
            {
                int value = System.Convert.ToInt32(s);
                tempAnswers.Add(tempId, value);
                tempId++;
            }
            catch
            {
                Debug.LogError("FormatException: " + s + " in " + tempId);
            }
        }

        foreach (int id in tempAnswers.Keys)
        {
            GridFlag gf = GridFlag.None;
            switch (tempAnswers[id])
            {
            case 1:
                gf = GridFlag.Black;
                break;

            case 2:
                gf = GridFlag.Negation;
                break;

            default:
                gf = GridFlag.White;
                break;
            }
            MainGame.SetOperationState(gf);
            MainGame.ChangeMyAnswer(id, gf);
            MainGame.SetOperationState(GridFlag.None);
        }
    }
Exemple #2
0
    private void SetAndDisplayNewColor()
    {
        if (shouldChangeColor)
        {
            MainGame.ChangeMyAnswer(this.ID, this.operationState);

            DisplayNewColor();

            if (MainGame.currentGameState == GameState.IsPuzzled)
            {
                SavingDataManager.CreateInstance().Save();
            }
            else
            {
                //SavingDataManager.CreateInstance().SaveToVictory();
            }
        }
    }