mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 00:45:43 +00:00
* refactor the code to make it more OOP and extensible
* remove old outdated SD project files * make it use some .NET 2.0 features as generic collections and settings svn path=/trunk/; revision=31130
This commit is contained in:
parent
588f8770cd
commit
82b5e2eb8b
31 changed files with 687 additions and 491 deletions
53
irc/TechBot/TechBot.Library/Command.cs
Normal file
53
irc/TechBot/TechBot.Library/Command.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
|
||||
namespace TechBot.Library
|
||||
{
|
||||
/*
|
||||
public interface ICommand
|
||||
{
|
||||
bool CanHandle(string commandName);
|
||||
void Handle(MessageContext context,
|
||||
string commandName,
|
||||
string parameters);
|
||||
//string Help();
|
||||
}*/
|
||||
|
||||
public abstract class Command
|
||||
{
|
||||
protected TechBotService m_TechBotService = null;
|
||||
|
||||
public Command(TechBotService techbot)
|
||||
{
|
||||
m_TechBotService = techbot;
|
||||
}
|
||||
|
||||
public TechBotService TechBot
|
||||
{
|
||||
get { return m_TechBotService; }
|
||||
}
|
||||
|
||||
public abstract string[] AvailableCommands { get; }
|
||||
|
||||
public abstract void Handle(MessageContext context,
|
||||
string commandName,
|
||||
string parameters);
|
||||
|
||||
/*
|
||||
protected bool CanHandle(string commandName,
|
||||
string[] availableCommands)
|
||||
{
|
||||
foreach (string availableCommand in availableCommands)
|
||||
{
|
||||
if (String.Compare(availableCommand, commandName, true) == 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
public virtual string Help()
|
||||
{
|
||||
return "No help is available for this command";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue