コード例 #1
0
ファイル: tower_stats.cs プロジェクト: Valensta/otherside
    public string getConciseString()
    {
        string summary = name + "|" + island_name;

        string all = "";

        for (int i = 0; i < this.skill_stats.Length; i++)
        {
            skill_stat_group g = skill_stats[i];

            string stats = "";
            foreach (skill_stat ss in g.skill_stats)
            {
                if (ss.xp > 0)
                {
                    stats += "|" + ss.lvl + "_" + Get.Round(ss.xp, 1) + "_" + Get.Round(ss.wave_start, 1);
                }
            }

            if (!stats.Equals(""))
            {
                all += ":" + (int)g.effect_type + stats;
            }
        }



        string hey = (all.Equals("")) ? "" : summary + all;

        return(hey);
    }
コード例 #2
0
ファイル: tower_stats.cs プロジェクト: Valensta/otherside
    public tower_stats TrimClone() //only use this when saving results to a file to save space
    {
        tower_stats my_clone = new tower_stats();

        my_clone.id          = this.id;
        my_clone.name        = string.Copy(this.name);
        my_clone.hits        = this.hits;
        my_clone.shots_fired = this.shots_fired;
        my_clone.lava_count  = this.lava_count;
        my_clone.island_name = string.Copy(this.island_name);

        List <skill_stat_group> new_list = new List <skill_stat_group>();

        foreach (skill_stat_group g in this.skill_stats)
        {
            skill_stat_group new_group = g.TrimClone();
            if (new_group != null)
            {
                new_list.Add(g);
            }
        }
        my_clone.skill_stats = new_list.ToArray();

        return(my_clone);
    }
コード例 #3
0
ファイル: tower_stats.cs プロジェクト: Valensta/otherside
    skill_stat_group newSkillStatGroup(EffectType type)
    {
        skill_stat_group st = new skill_stat_group();

        st.effect_type        = type;
        st.skill_stats        = new skill_stat[4];
        st.skill_stats[0]     = new skill_stat();
        st.skill_stats[0].lvl = 0;
        st.skill_stats[1]     = new skill_stat();
        st.skill_stats[1].lvl = 1;
        st.skill_stats[2]     = new skill_stat();
        st.skill_stats[2].lvl = 2;
        st.skill_stats[3]     = new skill_stat();
        st.skill_stats[3].lvl = 3;
        return(st);
    }