mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
On pCampBot, add bot as a property on behaviours instead of passing it in every time
This commit is contained in:
@@ -151,29 +151,29 @@ namespace pCampBot
|
||||
Array.ForEach<string>(
|
||||
cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b));
|
||||
|
||||
List<IBehaviour> behaviours = new List<IBehaviour>();
|
||||
|
||||
// Hard-coded for now
|
||||
if (behaviourSwitches.Contains("p"))
|
||||
behaviours.Add(new PhysicsBehaviour());
|
||||
|
||||
if (behaviourSwitches.Contains("g"))
|
||||
behaviours.Add(new GrabbingBehaviour());
|
||||
|
||||
if (behaviourSwitches.Contains("t"))
|
||||
behaviours.Add(new TeleportBehaviour());
|
||||
|
||||
// if (behaviourSwitches.Contains("c"))
|
||||
// behaviours.Add(new CrossBehaviour());
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"[BOT MANAGER]: Bots configured for behaviours {0}",
|
||||
string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray()));
|
||||
|
||||
for (int i = 0; i < botcount; i++)
|
||||
{
|
||||
string lastName = string.Format("{0}_{1}", lastNameStem, i);
|
||||
|
||||
List<IBehaviour> behaviours = new List<IBehaviour>();
|
||||
|
||||
// Hard-coded for now
|
||||
if (behaviourSwitches.Contains("p"))
|
||||
behaviours.Add(new PhysicsBehaviour());
|
||||
|
||||
if (behaviourSwitches.Contains("g"))
|
||||
behaviours.Add(new GrabbingBehaviour());
|
||||
|
||||
if (behaviourSwitches.Contains("t"))
|
||||
behaviours.Add(new TeleportBehaviour());
|
||||
|
||||
if (behaviourSwitches.Contains("c"))
|
||||
behaviours.Add(new CrossBehaviour());
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"[BOT MANAGER]: Bot {0} {1} configured for behaviours {2}",
|
||||
firstName, lastName, string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray()));
|
||||
|
||||
StartBot(this, behaviours, firstName, lastName, password, loginUri);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user