Rename Bot.BotManager to Manager

iar_mods
Justin Clark-Casey (justincc) 2011-11-23 21:33:10 +00:00
parent e9f2a9bddb
commit 9ae0641871
1 changed files with 16 additions and 9 deletions

View File

@ -49,8 +49,15 @@ namespace pCampBot
public delegate void AnEvent(Bot callbot, EventType someevent); // event delegate for bot events public delegate void AnEvent(Bot callbot, EventType someevent); // event delegate for bot events
public BotManager BotManager { get; private set; } /// <summary>
private IConfig startupConfig; // bot config, passed from BotManager /// Bot manager.
/// </summary>
public BotManager Manager { get; private set; }
/// <summary>
/// Bot config, passed from BotManager.
/// </summary>
private IConfig startupConfig;
/// <summary> /// <summary>
/// Behaviours implemented by this bot. /// Behaviours implemented by this bot.
@ -132,7 +139,7 @@ namespace pCampBot
Password = password; Password = password;
LoginUri = loginUri; LoginUri = loginUri;
BotManager = bm; Manager = bm;
startupConfig = bm.Config; startupConfig = bm.Config;
readconfig(); readconfig();
@ -222,7 +229,7 @@ namespace pCampBot
Client.Self.Jump(true); Client.Self.Jump(true);
// Extract nearby region information. // Extract nearby region information.
Client.Grid.GridRegion += BotManager.Grid_GridRegion; Client.Grid.GridRegion += Manager.Grid_GridRegion;
uint xUint, yUint; uint xUint, yUint;
Utils.LongToUInts(Client.Network.CurrentSim.Handle, out xUint, out yUint); Utils.LongToUInts(Client.Network.CurrentSim.Handle, out xUint, out yUint);
ushort minX, minY, maxX, maxY; ushort minX, minY, maxX, maxY;
@ -484,13 +491,13 @@ namespace pCampBot
private void GetTexture(UUID textureID) private void GetTexture(UUID textureID)
{ {
lock (BotManager.AssetsReceived) lock (Manager.AssetsReceived)
{ {
// Don't request assets more than once. // Don't request assets more than once.
if (BotManager.AssetsReceived.ContainsKey(textureID)) if (Manager.AssetsReceived.ContainsKey(textureID))
return; return;
BotManager.AssetsReceived[textureID] = false; Manager.AssetsReceived[textureID] = false;
Client.Assets.RequestImage(textureID, ImageType.Normal, Asset_TextureCallback_Texture); Client.Assets.RequestImage(textureID, ImageType.Normal, Asset_TextureCallback_Texture);
} }
} }
@ -502,8 +509,8 @@ namespace pCampBot
public void Asset_ReceivedCallback(AssetDownload transfer, Asset asset) public void Asset_ReceivedCallback(AssetDownload transfer, Asset asset)
{ {
lock (BotManager.AssetsReceived) lock (Manager.AssetsReceived)
BotManager.AssetsReceived[asset.AssetID] = true; Manager.AssetsReceived[asset.AssetID] = true;
// if (wear == "save") // if (wear == "save")
// { // {