VR-Forces 4.0.4 Class Documentation
examples/bhaveRemoteControl/textIf.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2007 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: textIf.h,v $ $Revision: 1.10 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 #ifndef DtTextInterface_H_
00010 #define DtTextInterface_H_
00011 
00012 #include "vlutil/vlUtil.h"
00013 #include "vl/globalObjDes.h"
00014 
00015 //This class provides a text interface for testing the BHAVE messages API
00016 //via a VRForces remote controller.
00018 //This interface currently supports the following actions:
00019 //
00020 //1. Create a M1A2 tank at a predefined location 
00022 //2. Task the tank to wander (BHAVE wander task)
00024 //3. Request to the backend the list of available LUA scripts
00026 //4. quit the application
00027 
00028 class DtVrfRemoteController;
00029 class DtSimMessage;
00030 
00031 class DtTextInterface
00032 {
00033 
00034 public:
00035   
00036   //constructor
00037   DtTextInterface(DtVrfRemoteController* controller);
00038 
00039   //destructor
00040   virtual ~DtTextInterface();
00041 
00042   //Process entered text
00043   void readStdin();
00044   void createScenario(char* str);
00045 
00046   //Set/Get time to quit
00047   virtual void setTimeToQuit(bool yesNo);
00048   virtual bool timeToQuit() const;
00049 
00050   //To test whether the scenario has been loaded
00051   virtual bool scenarioLoaded() const;
00052 
00053   //Show the menu
00054   void prompt();
00055 
00056   //Get remote vrf controller pointer
00057   virtual DtVrfRemoteController* controller() const;
00058 
00059 public:
00060 
00061   //Functions for calling the corresponding methods on DtVrfRemoteController.
00062 
00063   virtual void createTank(char* str);
00064 
00065   virtual void createWanderTask();
00066 
00067   virtual void requestScriptsList();
00068 
00069    //-------------------------------------------------------
00070    //DtVrfRemoteController callback functions
00071    //-------------------------------------------------------
00072 
00073    //Scenario loaded/saved callbacks
00074    static void scenarioLoadedCb(void* usr);
00075 
00076    //VR-Forces object created callback
00077    static void vrfObjectCreatedCb(
00078       const DtString& name, const DtEntityIdentifier& id, void* usr);
00079 
00080    //LUA Script list callback
00081    static void requestLuaScriptsCb(DtSimMessage* msg, void* usr);
00082 
00083 
00084 protected:
00085 
00086    bool myTimeToQuit;      
00087    DtVrfRemoteController* myController;
00088    static bool myScenarioLoaded;   
00089    static bool myTankCreated;
00090    static DtString myMsg;
00091 
00092 };
00093 
00094 
00095 #endif
00096 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)