コード例 #1
0
    //////////////////////////////////////////////////////////

    // Utility function for updating tracked level info.
    public void SetChallengeStats(string name, int score, bool onlyIncrease = true)
    {
        for (int i = 0; i < challenges.Count; ++i)
        {
            if (challenges[i].name.Equals(name))
            {
                if (!onlyIncrease || score > challenges[i].stars)
                {
                    challenges[i] = new DataChallenge(score, name);
                }

                return;
            }
        }
    }
コード例 #2
0
    public List <DataChallenge> ListFromString(string toRead)
    {
        List <DataChallenge> parsed = new List <DataChallenge>();

        if (string.IsNullOrEmpty(toRead))
        {
            return(parsed);
        }

        string[] split = toRead.Split(valueSeparator);

        for (int i = 0; i < split.Length; ++i)
        {
            DataChallenge dataChallenge = new DataChallenge();
            dataChallenge.FromString(split[i]);
            parsed.Add(dataChallenge);
        }

        return(parsed);
    }
コード例 #3
0
ファイル: DataChallenge.cs プロジェクト: LoamNet/Bubbles
 public DataChallenge(DataChallenge other)
 {
     this.stars = other.stars;
     this.name  = other.name;
 }