// Constructor public ConsoleBotInstance(GridClient client) { m_globalInstance = this; m_Client = client; m_netManager = new NetworkManager(this); m_moveManager = new MovementManager(this); m_objManager = new ObjectEvtManager(this); }
public ActionManager(ConsoleBotInstance instance) { m_BotInstance = instance; m_MoveManager = m_BotInstance.MoveManager; m_Timer = new System.Timers.Timer(500); m_Timer.Elapsed += new ElapsedEventHandler(ActionTimerElapsed); m_Timer.Enabled = false; m_CurrentAction = Action.None; m_bEableAction = false; }
private void EnableAction(MovementManager mm, Action action, bool bStart, bool bTimerEnable) { switch (action) { case Action.GoForward: mm.GoForward = bStart; break; case Action.GoBack: mm.GoBack = bStart; break; case Action.TurnLeft: mm.TurnLeft = bStart; break; case Action.TurnRight: mm.TurnRight = bStart; break; case Action.bow: mm.DoGesture(m_GestureHello); break; case Action.Fly: mm.Fly = mm.Fly ? false : true; break; case Action.GoToward: //mm.MoveToward(m_BotInstance.ObjEvtManager.Destination); mm.MoveTowardIndirect(m_BotInstance.ObjEvtManager.Destination); break; // continuous walking - require stop action case Action.Move: mm.GoForward = bStart; break; default: break; } m_Timer.Enabled = bTimerEnable; }