Steveice10/mc-protocol-lib — pull request #7 by dezmond (2013-09-15 11:35:29+00:00)
Title: Added Visitor Pattern

Hi,

I'm using mc-protocol-lib to create a bot, of sorts and I wasn't happy with the route of creating a huge switch statement to deal with all the packets so I explored the idea of using the visitor pattern as it was the least invasive option. After implementing it I figured others might be interested and here we are...

I've create a ChatBotVisitor class which demonstrates how it would be used, for this simple example you hardly reap the benefits of doing it this way but it clearly shows how it is used.

Keep up the good work.