What I notice is that there is a huge case that could be eliminated if you implement something like:
public class ParseData{
public string nick {get;set;}
public string msg {get;set;}
}
interface IIRCParse{
ParseData Parse();
}
public IRCParse001 : IIRCParse{
public ParseData Parse()
{
//implementacion
}
}
public IRCParse006 : IIRCParse{
public ParseData Parse()
{
//implementacion
}
}
//resto implementaciones
Each code is parsed separately in a class, and all inherit from an interface.
And you would use it by means of:
Dictionary<string, IIRCParse> ircParses = new Dictionary<string, IIRCParse>(){
{"001", new IRCParse001()},
{"006", new IRCParse006()},
//resto
};
IIRCParse parseInstance = ircParses[ircData[1]]
ParseData data = parseInstance.Parse();
in this way you avoid the% co_of huge% and you can separate each code in a different implementation
The challenge is to normalize the parse for all the codes, which return the same set of data as an answer
In the example use a switch
but you use some library of IoC (Unity, Ninject, StruncturaMap, autofac, etc) even better, since in this you could map the code to an implementation and apply the resolve to determine that Parser instance applies.