Add pCampbot "remove behaviour" console command for removing bot behaviours during operation.

Doesn't currently work very well as stopping physics, for instance, can leave bot travelling in old direction
This commit is contained in:
Justin Clark-Casey (justincc)
2013-09-03 19:05:54 +01:00
parent 9bd6271570
commit 1a2627031d
2 changed files with 60 additions and 5 deletions

View File

@@ -184,6 +184,12 @@ namespace pCampBot
CreateLibOmvClient();
}
public bool TryGetBehaviour(string abbreviatedName, out IBehaviour behaviour)
{
lock (Behaviours)
return Behaviours.TryGetValue(abbreviatedName, out behaviour);
}
public bool AddBehaviour(IBehaviour behaviour)
{
lock (Behaviours)
@@ -200,6 +206,12 @@ namespace pCampBot
return false;
}
public bool RemoveBehaviour(string abbreviatedName)
{
lock (Behaviours)
return Behaviours.Remove(abbreviatedName);
}
private void CreateLibOmvClient()
{
GridClient newClient = new GridClient();