Esempio n. 1
0
        // 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);
        }
Esempio n. 2
0
        // Constructor
        public NetworkManager()
        {
            m_FirstName = null;
            m_LastName  = strFixedLastName;
            m_Password  = null;

            m_BotInstance = null;

            m_bSetLoginParam = false;
        }
Esempio n. 3
0
        // Constructor
        public NetworkManager()
        {
            m_FirstName = null;
            m_LastName = strFixedLastName;
            m_Password = null;

            m_BotInstance = null;

            m_bSetLoginParam = false;
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
        public MovementManager()
        {
            // do nothing
            m_BotInstance = null;
            m_Client      = null;

            m_GoForward = false;
            m_GoBack    = false;
            m_TurnRight = false;
            m_TurnLeft  = false;
            m_Flying    = false;
        }
Esempio n. 6
0
        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;
        }
Esempio n. 7
0
        public MovementManager()
        {
            // do nothing
            m_BotInstance = null;
            m_Client = null;

            m_GoForward = false;
            m_GoBack = false;
            m_TurnRight = false;
            m_TurnLeft = false;
            m_Flying = false;
        }
Esempio n. 8
0
        public ChatManager(ConsoleBotInstance botInstance)
        {
            m_Client     = botInstance.Client;
            m_objManager = botInstance.ObjEvtManager;

            m_actionManager = new ActionManager(botInstance);
            m_Client.Self.ChatFromSimulator += new EventHandler <ChatEventArgs>(OnChatFromSimulator);

            // m_Sensor = new Sensor("jl2", "user2", botInstance.NetManager.Password, Constant.NODE_PERCEPT);
            m_Sensor = new Sensor("jl2", botInstance.NetManager.Username + "_client", botInstance.NetManager.Password, botInstance.NetManager.Username + "_percept");
            m_Sensor.SensorCreateEvent += new SensorCreateEventHandler(OnSensorCreateEvent);
        }
Esempio n. 9
0
        public ChatManager(ConsoleBotInstance botInstance)
        {
            m_Client = botInstance.Client;
            m_objManager = botInstance.ObjEvtManager;

            m_actionManager = new ActionManager(botInstance);
            m_Client.Self.ChatFromSimulator += new EventHandler<ChatEventArgs>(OnChatFromSimulator);

            // m_Sensor = new Sensor("jl2", "user2", botInstance.NetManager.Password, Constant.NODE_PERCEPT);
            m_Sensor = new Sensor("jl2", botInstance.NetManager.Username + "_client", botInstance.NetManager.Password, botInstance.NetManager.Username + "_percept");
            m_Sensor.SensorCreateEvent += new SensorCreateEventHandler(OnSensorCreateEvent);
        }
Esempio n. 10
0
        public NetworkManager(ConsoleBotInstance botInstance)
        {
            m_FirstName = null;
            m_LastName = strFixedLastName;
            m_Password = null;

            m_BotInstance = botInstance;
            m_GridClient = m_BotInstance.Client;

            m_bSetLoginParam = false;

            if (m_GridClient != null)
                RegisterEventHandler();
        }
Esempio n. 11
0
        public MovementManager(ConsoleBotInstance instance)
        {
            m_BotInstance = instance;
            m_Client = m_BotInstance.Client;

            m_GoForward = false;
            m_GoBack = false;
            m_TurnRight = false;
            m_TurnLeft = false;
            m_Flying = false;

            m_Timer = new System.Timers.Timer(500);
            m_Timer.Elapsed += new ElapsedEventHandler(TurnTimerElapsed);
            m_Timer.Enabled = false;
        }
Esempio n. 12
0
        public MovementManager(ConsoleBotInstance instance)
        {
            m_BotInstance = instance;
            m_Client      = m_BotInstance.Client;

            m_GoForward = false;
            m_GoBack    = false;
            m_TurnRight = false;
            m_TurnLeft  = false;
            m_Flying    = false;

            m_Timer          = new System.Timers.Timer(500);
            m_Timer.Elapsed += new ElapsedEventHandler(TurnTimerElapsed);
            m_Timer.Enabled  = false;
        }
Esempio n. 13
0
        public ObjectEvtManager(ConsoleBotInstance botInstance)
        {
            m_botInstance = botInstance;
            m_GridClient = botInstance.Client;

            m_rotation = m_GridClient.Self.SimRotation;

            if (m_GridClient != null)
            {
                RegisterEventHandler();
            }

            m_ir = new IntentionRecogniser(botInstance);
            m_PosDest = new Vector3(NOINIT, NOINIT, NOINIT);
            m_oldPos = new Vector3(NOINIT, NOINIT, NOINIT);
        }
Esempio n. 14
0
        public NetworkManager(ConsoleBotInstance botInstance)
        {
            m_FirstName = null;
            m_LastName  = strFixedLastName;
            m_Password  = null;

            m_BotInstance = botInstance;
            m_GridClient  = m_BotInstance.Client;

            m_bSetLoginParam = false;

            if (m_GridClient != null)
            {
                RegisterEventHandler();
            }
        }
Esempio n. 15
0
        public ObjectEvtManager(ConsoleBotInstance botInstance)
        {
            m_botInstance = botInstance;
            m_GridClient  = botInstance.Client;

            m_rotation = m_GridClient.Self.SimRotation;

            if (m_GridClient != null)
            {
                RegisterEventHandler();
            }

            m_ir      = new IntentionRecogniser(botInstance);
            m_PosDest = new Vector3(NOINIT, NOINIT, NOINIT);
            m_oldPos  = new Vector3(NOINIT, NOINIT, NOINIT);
        }
Esempio n. 16
0
        static void Main(string[] args)
        {
            // Init instance
            ConsoleBotInstance instance = ConsoleBotInstance.GloblaInstance;

            // Set login parameter from user input
            if (instance.NetManager.SetLoginParam(args) != true)
            {
                Console.WriteLine("Fail to set login info. Try again");
                return;
            }
            else
            {
                instance.InitailiseBSF(instance.NetManager.Username, instance.NetManager.Password);
            }

            // Run main program in Bot
            instance.Run();
        }
Esempio n. 17
0
 //////////////////////////////////////////////////////////////////////////
 // Methods
 //////////////////////////////////////////////////////////////////////////
 // Constructor
 public ConsoleBotInstance()
 {
     m_globalInstance = this;
     m_Client = new GridClient();
 }