IsTimeStat() public static method

Returns whether a parameter key's valueis a time related statistic
public static IsTimeStat ( string Name ) : bool
Name string
return bool
        /// <summary>
        /// Covnerts the conditions into a TreeNode
        /// </summary>
        /// <returns></returns>
        public override TreeNode ToTree()
        {
            string Name;
            string P2 = "";

            // Define start of description
            if (Params[0] == "global_stat")
            {
                Name = "Global " + StatsConstants.PythonGlobalVars[Params[1]];
            }
            else
            {
                Name = "Round " + StatsConstants.PythonPlayerVars[Params[1]];
            }

            // If we have 3 params, parse the last paramenter
            if (Params.Count == 3)
            {
                if (StatsConstants.IsTimeStat(Params[1]))
                {
                    P2 = Condition.Sec2hms(Int32.Parse(Params[2]));
                }
                else
                {
                    P2 = String.Format("{0:N0}", Int32.Parse(Params[2]));
                }

                Name += " Equal to or Greater Than " + P2;
            }

            TreeNode Me = new TreeNode(Name);

            Me.Tag = this;
            return(Me);
        }
 /// <summary>
 /// Sets the params for this condition
 /// </summary>
 /// <param name="Params"></param>
 public override void SetParams(List <string> Params)
 {
     this.Params = Params;
     if (Params[0] == "player_stat" && !StatsConstants.IsTimeStat(Params[1]))
     {
         Params[0] = "player_score";
     }
 }
 public PlayerStat(List <string> Params)
 {
     this.Params = Params;
     if (Params[0] == "player_stat" && !StatsConstants.IsTimeStat(Params[1]))
     {
         Params[0] = "player_score";
     }
 }
Example #4
0
        /// <summary>
        /// Covnerts the conditions into a TreeNode
        /// </summary>
        /// <returns></returns>
        public override TreeNode ToTree()
        {
            // Achieve award less times then
            string Type  = StatsConstants.PythonGlobalVars[Params[1]];
            string Value = (StatsConstants.IsTimeStat(Params[1]))
                ? Condition.Sec2hms(Int32.Parse(Params[2]))
                : String.Format("{0:N0}", Int32.Parse(Params[2]));

            TreeNode Me = new TreeNode("Achieved " + Value + " Global " + Type + " One or More Times");

            Me.Tag = this;
            return(Me);
        }