mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Separate out physics testing actions into a separate PhysicsBehaviour class
This commit is contained in:
@@ -37,6 +37,7 @@ using log4net.Repository;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using pCampBot.Interfaces;
|
||||
|
||||
namespace pCampBot
|
||||
{
|
||||
@@ -119,10 +120,14 @@ namespace pCampBot
|
||||
string password = cs.GetString("password");
|
||||
string loginUri = cs.GetString("loginuri");
|
||||
|
||||
// Hardcoded for new
|
||||
List<IBehaviour> behaviours = new List<IBehaviour>();
|
||||
behaviours.Add(new PhysicsBehaviour());
|
||||
|
||||
for (int i = 0; i < botcount; i++)
|
||||
{
|
||||
string lastName = string.Format("{0}_{1}", lastNameStem, i);
|
||||
startupBot(i, this, firstName, lastName, password, loginUri);
|
||||
startupBot(i, this, behaviours, firstName, lastName, password, loginUri);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,14 +155,17 @@ namespace pCampBot
|
||||
/// This starts up the bot and stores the thread for the bot in the thread array
|
||||
/// </summary>
|
||||
/// <param name="pos">The position in the thread array to stick the bot's thread</param>
|
||||
/// <param name="cs">Configuration of the bot</param>
|
||||
/// <param name="bm"></param>
|
||||
/// <param name="behaviours">Behaviours for this bot to perform.</param>
|
||||
/// <param name="firstName">First name</param>
|
||||
/// <param name="lastName">Last name</param>
|
||||
/// <param name="password">Password</param>
|
||||
/// <param name="loginUri">Login URI</param>
|
||||
public void startupBot(int pos, BotManager bm, string firstName, string lastName, string password, string loginUri)
|
||||
public void startupBot(
|
||||
int pos, BotManager bm, List<IBehaviour> behaviours,
|
||||
string firstName, string lastName, string password, string loginUri)
|
||||
{
|
||||
PhysicsBot pb = new PhysicsBot(bm, firstName, lastName, password, loginUri);
|
||||
PhysicsBot pb = new PhysicsBot(bm, behaviours, firstName, lastName, password, loginUri);
|
||||
|
||||
pb.OnConnected += handlebotEvent;
|
||||
pb.OnDisconnected += handlebotEvent;
|
||||
|
||||
Reference in New Issue
Block a user