RoboZhando/CommandNext/Query.cs
/// <summary>
/// Checks if we have all the keys passed. Ignores if we have extra keys, as long as we have the ones we want.
/// </summary>
/// <param name="keys">Any number of keys that is required</param>
/// <returns>True if all keys are available</returns>
Checks if we have all the keys passed. Ignores if we have extra keys, as long as we have the ones we want.
Checks if we have all the keys passed . Ignores if we have extra keys as long as we have the ones we want .
public bool Validate(params string[] keys)
        {
            if (keys.Length > this.Count) return false;
            for (int i = 0; i < keys.Length; i++)
            {
                if (i > this.Count || !this.ContainsKey(keys[i]))
                    return false;
            }
            return true;
        }
public bool Validate ( params string [ ] keys ) { if ( keys . Length > this . Count ) return false ; for ( int i = 0 ; i < keys . Length ; i ++ ) { if ( i > this . Count || ! this . ContainsKey ( keys [ i ] ) ) return false ; } return true ; }
Checks if we have all the keys passed.
Checks if we have all the keys passed .
//How can we possibly have enough keys?
True if all keys are available
True if all keys are available
keys
Any number of keys that is required
Any number of keys that is required