Ejemplo n.º 1
0
 /// <summary>
 /// Gets the index from the argument index based on the value.
 /// </summary>
 /// <param name="variable">The value in the array.</param>
 /// <returns>The index of the value.</returns>
 public int IndexOfVariable(CommandArgVariable variable)
 {
     if (!(IsEmpty()))
     {
         return(IndexOfArg($"{variable.GetHeader()}{variable.GetValue()}"));
     }
     return(0);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Checks to see if the argument array ends with the specified value.
 /// </summary>
 /// <param name="value">The value to check.</param>
 /// <returns>Whether the variable was found at the ends of the array.</returns>
 public bool EndsWithVariable(CommandArgVariable variable)
 {
     if (!(IsEmpty()) && (EndsWithArgument($"{variable.GetHeader()}{variable.GetValue()}")))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Checks the argument array has the following argument at the specified location within the array.
 /// </summary>
 /// <param name="pos">The position within the array.</param>
 /// <param name="variable">The variable to look for in the array.</param>
 /// <returns>Whether the array contains the variable.</returns>
 public bool ContainsVariable(int pos, CommandArgVariable variable)
 {
     if (!(IsEmpty()))
     {
         if (ContainsArg(pos, $"{variable.GetHeader()}{variable.GetValue()}"))
         {
             return(true);
         }
     }
     return(false);
 }