Add support for C# script extensions

- Allow defining function for use into the script
- Allow defining a ChatBot for loading it into MCC
- Improve sample script and add more examples
- Todo add new documentation into the readme file
This commit is contained in:
ORelio 2015-06-21 18:45:43 +02:00
parent a6b3bf0481
commit e29b4ee545
6 changed files with 115 additions and 26 deletions

View file

@ -33,9 +33,10 @@ namespace MinecraftClient
{
public enum DisconnectReason { InGameKick, LoginRejected, ConnectionLost };
//Will be automatically set on bot loading, don't worry about this
//Handler will be automatically set on bot loading, don't worry about this
public void SetHandler(McTcpClient handler) { this._handler = handler; }
public void SetMaster(ChatBot master) { this.master = master; }
protected void SetMaster(ChatBot master) { this.master = master; }
protected void LoadBot(ChatBot bot) { Handler.BotUnLoad(bot); Handler.BotLoad(bot); }
private McTcpClient Handler { get { return master != null ? master.Handler : _handler; } }
private McTcpClient _handler = null;
private ChatBot master = null;