// Sends a BashCommand public void Send(BashCommand command) { Send(command.ToString()); }
protected virtual void OnCommandRecieved(BashCommand line) { if (CommandRecieved != null) CommandRecieved(line); }
// Handles Chat & Bout Commands public void ProcessLine(BashCommand command) { // Send the command to all event handlers OnCommandRecieved(command); if (command.Name == BashCommand.Chat) { // Send the chat to all event handlers OnChatRecieved(command); } else if (command.Name == BashCommand.Bout) { if (command.Value == BashCommand.BoutEndString) { // Here we have built up _tempUsers fully // so we set Users to _tempUsers // and create a new List for the next BOUT list Users = _tempUsers; _tempUsers = new List<BashBout>(); // Send the users to all event handlers OnBoutListUpdate(Users); } else { // Parse and add the bout to the temporary list var bout = BashBoutParser.Parse(command.Value); _tempUsers.Add(bout); } } }