VR-Forces 4.0.4 Class Documentation
include/vrfmodel/launchExpendableResourceController.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2008 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: launchExpendableResourceCtlr.h,v $ $Revision: 1.1 $ $State: Exp $
00007 ** Created: 4/28/11 MEM
00008 *******************************************************************************/
00009 
00012 
00013 #pragma once
00014 
00015 #include "vrfobjcore/singleTaskControllerComponent.h"
00016 #include "vlutil/vlString.h"
00017 #include "vrfmodel/vrfmodelDefines.h"
00018 
00019 class DtLaunchExpendableResourcePSR;
00020 class DtLaunchExpendableResourceControllerDescriptor;
00021 class DtLaunchExpendableResourceTask;
00022 class DtMunitionResource;
00023 
00029 class DT_DLL_vrfmodel DtLaunchExpendableResourceController : public DtSingleTaskControllerComponent
00030 {
00031 public:
00033    DtLaunchExpendableResourceController(const DtString & name, DtVrfObject* owner, 
00034       DtSimManager * simManager, DtComponentDescriptor* desc = NULL,
00035       DtReaderWriterRegistry * parentRegistry = 0);
00036 
00038    virtual ~DtLaunchExpendableResourceController();
00039 
00041    DtLaunchExpendableResourceController(const DtLaunchExpendableResourceController& orig);
00042 
00044    DtLaunchExpendableResourceController& operator=(const DtLaunchExpendableResourceController& orig);
00045 
00048    virtual DtString type() const;
00049 
00051    virtual void registerTaskMsgCallbacks();
00052 
00056    static void launchExpendableResourceTaskCallback(DtSimMessage * msg, void * usr);
00057 
00058    static void setAutoLaunchEnabledCallback(DtSimMessage * msg, void * usr);
00059 
00062    virtual void processLaunchExpendableResourceTask(DtSimMessage * msg);
00063 
00066    virtual void processSetAutoLaunchEnabled(DtSimMessage* msg);
00067 
00070    virtual bool init();
00071 
00074    virtual void tick();
00075 
00077    virtual void taskComplete(bool success = true);
00078 
00080    static DtSimComponent* creator(const DtString & name, DtVrfObject* owner,
00081       DtSimManager * simManager, DtComponentDescriptor* desc,
00082       DtReaderWriterRegistry * parentRegistry);
00083 
00087    virtual DtMunitionResource* lookupExpendableResource(const DtString & resourceName);
00088 
00094    virtual bool launchExpendableResources(int numberToFire);
00095 
00096 protected:
00097    
00099    virtual bool createPSR();
00100 
00105    virtual bool autoLaunchTriggered();
00106 
00107    virtual DtString selectResourceForAutoLaunch(const DtObjectType & missileType);
00108 
00109    virtual void setupAutoLaunchTriggerList();
00110    virtual void setUpAutoLaunchTaskFromDescriptor();
00111 
00113    DtVrfObject* createResourceObject(const DtObjectType & objType);
00114 
00115 protected:
00116    const DtLaunchExpendableResourceControllerDescriptor* myDesc;
00117 
00120    DtLaunchExpendableResourcePSR*    myProcessState;
00121 
00123    bool              myFirstTick;
00124 
00125    double            myTimeInterval;
00126    DtString          myResourceName;
00127    int               myNumberPerInterval;
00128    DtLaunchExpendableResourceTask *       myAutoLaunchTask;
00129 
00130    DtManagedObjectListConstPtr myAutoDetectObjectsList;
00131 };
00132 

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)