On pCampBot, add bot as a property on behaviours instead of passing it in every time

This commit is contained in:
Justin Clark-Casey (justincc)
2011-11-24 22:36:45 +00:00
parent cbbd992df4
commit 2ae5b40ca6
7 changed files with 115 additions and 56 deletions

View File

@@ -130,6 +130,8 @@ namespace pCampBot
BotManager bm, List<IBehaviour> behaviours,
string firstName, string lastName, string password, string loginUri)
{
behaviours.ForEach(b => b.Initialize(this));
Client = new GridClient();
Random = new Random(Environment.TickCount);// We do stuff randomly here
@@ -156,7 +158,7 @@ namespace pCampBot
b =>
{
// m_log.DebugFormat("[pCAMPBOT]: For {0} performing action {1}", Name, b.GetType());
b.Action(this);
b.Action();
Thread.Sleep(Random.Next(1000, 10000));
}