Game Development Reference
In-Depth Information
if (!match.Success)
{
Check if a parameter has already been determined and that the current character
selection is its value.
if (currentToken != null)
{
_parameters[currentToken] = argument.Trim(trimCharacters);
}
If an argument was specified that is not in the form of a parameter, then it is most
likely a file to process, so here we add the argument to the files collection.
else
{
_files.Add(argument);
}
}
else
{
currentToken = match.Groups[“name”].Value;
string tokenValue =
match.Groups[“value”].Value.Trim(trimCharacters);
If no value was found, specify true as the default parameter value. Having a default
value of true basically means that a flag or switch was specified (on or off value).
if (tokenValue.Length == 0)
{
_parameters[currentToken] = “true”;
}
If a value was determined, associate the string dictionary key with it.
else
{
_parameters[currentToken] = tokenValue;
}
}
}
}
}
}
Search Nedrilad ::




Custom Search