Exemple #1
0
    public void Koef(ZRSettings sets)
    {
        for (int i = 0; i < count; i++)
        {
            if (!sets.names.Contains(this.names[i]))
            {
                continue;
            }
            ZRValue val = this.values[i];

            val.current += val.max * sets[this.names[i]].percent;
            //Debug.Log(this.names[i] + ":" + sets[this.names[i]].percent + ": " + sets[this.names[i]]);
            if (val.peaked)
            {
                val.Refresh();
            }
            if (val.minimum)
            {
                val.Reset();
            }
            if (this.names[i] == ZRSetting.Cage)
            {
                val.current = (int)val.current;
                //Debug.Log(val.ToString());
            }
        }
        Init();
    }
Exemple #2
0
 public void Replace(ZRSettings sets)
 {
     for (int i = 0; i < count; i++)
     {
         if (sets.names.Contains(this.names[i]))
         {
             this.values[i] = sets[this.names[i]];
         }
     }
 }
Exemple #3
0
    public ZRSettings Clone()
    {
        ZRSettings setts = new ZRSettings();

        for (int i = 0; i < count; i++)
        {
            setts.Add(names[i], values[i].Clone());
        }
        setts.Init();
        return(setts);
    }
Exemple #4
0
 public void Contact(ZRSettings sets)
 {
     for (int i = 0; i < sets.count; i++)
     {
         if (this.Contains(sets.names[i]))
         {
             continue;
         }
         this.Add(sets.names[i], sets.values[i]);
     }
 }
Exemple #5
0
 public void Multyply(ZRSettings sets)
 {
     for (int i = 0; i < count; i++)
     {
         if (sets.names.Contains(this.names[i]))
         {
             this.values[i] *= sets[this.names[i]].percent;
         }
     }
     Init();
 }
Exemple #6
0
    public static ZRSettings operator /(ZRSettings one, float value)
    {
        ZRSettings settings = new ZRSettings();

        for (int i = 0; i < one.count; i++)
        {
            settings.Add(one.names[i], one.values[i] / value);
        }
        settings.Init();
        return(settings);
    }
Exemple #7
0
    public void Addition(ZRSettings sets)
    {
        for (int i = 0; i < count; i++)
        {
            if (sets.names.Contains(this.names[i]))
            {
                ZRValue val = this.values[i] * sets[this.names[i]].percent;

                if (this.names[i] == ZRSetting.Cage)
                {
                    val.ToInt();
                }
                this.values[i] += val;
            }
        }
        Init();
    }
Exemple #8
0
    public static ZRSettings operator -(ZRSettings one, ZRSettings two)
    {
        ZRSettings settings = new ZRSettings();

        for (int i = 0; i < one.count; i++)
        {
            if (!settings.Contains(one.names[i]))
            {
                settings.Add(one.names[i], new ZRValue(0));
            }
            settings[one.names[i]] = one.values[i] - two[one.names[i]];
        }
        for (int i = 0; i < two.count; i++)
        {
            if (settings.Contains(two.names[i]))
            {
                continue;
            }
            settings.Add(two.names[i], two.values[i] * (-1));
        }
        settings.Init();
        return(settings);
    }