diff options
author | Justin Clark-Casey (justincc) | 2011-11-24 22:36:45 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-24 22:36:45 +0000 |
commit | 2ae5b40ca6bb3d33310f0f66569bf150548a2de6 (patch) | |
tree | 9c485fa9e2e9d1b2d976d3b6d9777457b836df36 /OpenSim/Tools/pCampBot/BotManager.cs | |
parent | minor: remove mono compiler warning (diff) | |
download | opensim-SC-2ae5b40ca6bb3d33310f0f66569bf150548a2de6.zip opensim-SC-2ae5b40ca6bb3d33310f0f66569bf150548a2de6.tar.gz opensim-SC-2ae5b40ca6bb3d33310f0f66569bf150548a2de6.tar.bz2 opensim-SC-2ae5b40ca6bb3d33310f0f66569bf150548a2de6.tar.xz |
On pCampBot, add bot as a property on behaviours instead of passing it in every time
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tools/pCampBot/BotManager.cs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index d91990f..6481e97 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -151,29 +151,29 @@ namespace pCampBot | |||
151 | Array.ForEach<string>( | 151 | Array.ForEach<string>( |
152 | cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b)); | 152 | cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b)); |
153 | 153 | ||
154 | List<IBehaviour> behaviours = new List<IBehaviour>(); | ||
155 | |||
156 | // Hard-coded for now | ||
157 | if (behaviourSwitches.Contains("p")) | ||
158 | behaviours.Add(new PhysicsBehaviour()); | ||
159 | |||
160 | if (behaviourSwitches.Contains("g")) | ||
161 | behaviours.Add(new GrabbingBehaviour()); | ||
162 | |||
163 | if (behaviourSwitches.Contains("t")) | ||
164 | behaviours.Add(new TeleportBehaviour()); | ||
165 | |||
166 | // if (behaviourSwitches.Contains("c")) | ||
167 | // behaviours.Add(new CrossBehaviour()); | ||
168 | |||
169 | MainConsole.Instance.OutputFormat( | ||
170 | "[BOT MANAGER]: Bots configured for behaviours {0}", | ||
171 | string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray())); | ||
172 | |||
173 | for (int i = 0; i < botcount; i++) | 154 | for (int i = 0; i < botcount; i++) |
174 | { | 155 | { |
175 | string lastName = string.Format("{0}_{1}", lastNameStem, i); | 156 | string lastName = string.Format("{0}_{1}", lastNameStem, i); |
176 | 157 | ||
158 | List<IBehaviour> behaviours = new List<IBehaviour>(); | ||
159 | |||
160 | // Hard-coded for now | ||
161 | if (behaviourSwitches.Contains("p")) | ||
162 | behaviours.Add(new PhysicsBehaviour()); | ||
163 | |||
164 | if (behaviourSwitches.Contains("g")) | ||
165 | behaviours.Add(new GrabbingBehaviour()); | ||
166 | |||
167 | if (behaviourSwitches.Contains("t")) | ||
168 | behaviours.Add(new TeleportBehaviour()); | ||
169 | |||
170 | if (behaviourSwitches.Contains("c")) | ||
171 | behaviours.Add(new CrossBehaviour()); | ||
172 | |||
173 | MainConsole.Instance.OutputFormat( | ||
174 | "[BOT MANAGER]: Bot {0} {1} configured for behaviours {2}", | ||
175 | firstName, lastName, string.Join(",", behaviours.ConvertAll<string>(b => b.Name).ToArray())); | ||
176 | |||
177 | StartBot(this, behaviours, firstName, lastName, password, loginUri); | 177 | StartBot(this, behaviours, firstName, lastName, password, loginUri); |
178 | } | 178 | } |
179 | } | 179 | } |