BVB Source Codes

CRYENGINE Show GoalOpFactory.h Source code

Return Download CRYENGINE: download GoalOpFactory.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /********************************************************************
  4.    -------------------------------------------------------------------------
  5.    File name:   ScriptBind_AI.h
  6.    Description: Goal Op Factory interface and management classes
  7.  
  8.    -------------------------------------------------------------------------
  9.    History:
  10.    -24:02:2008   - Created by Matthew
  11.  
  12.  *********************************************************************/
  13.  
  14. #ifndef __GoalOpFactory_H__
  15. #define __GoalOpFactory_H__
  16.  
  17. #pragma once
  18.  
  19. #include <CryAISystem/IGoalPipe.h>
  20.  
  21. /** Interface for classes than can create and return a goalop instance */
  22. struct IGoalOpFactory
  23. {
  24.         virtual ~IGoalOpFactory(){}
  25.         /**
  26.          * Create a goalop instance
  27.          * Attempts to create a goalop instance from the goalop name and script arguments.
  28.          * Should return NULL if not recognised.
  29.          * @return A new goalop instance or NULL, and correct parameters
  30.          */
  31.         virtual IGoalOp* GetGoalOp(const char* sGoalOpName, IFunctionHandler* pH, int nFirstParam, GoalParameters& params) const = 0;
  32.  
  33.         /**
  34.          * Create a goalop instance
  35.          * Attempts to create a goalop instance from the goalop id and parameters.
  36.          * Should return NULL if not recognised.
  37.          * @return A new goalop instance or NULL
  38.          */
  39.         virtual IGoalOp* GetGoalOp(EGoalOperations name, GoalParameters& params) const = 0;
  40. };
  41.  
  42. /**
  43.  * An ordering of goalop factories.
  44.  * Attempts to delegate to a series of factories in the order they were added and returns the first result.
  45.  * Should return NULL if none of them recognize the goalop.
  46.  * An empty ordering will always return NULL;
  47.  * @return A new goalop instance or NULL
  48.  */
  49. class CGoalOpFactoryOrdering : public IGoalOpFactory
  50. {
  51. public:
  52.         IGoalOp* GetGoalOp(const char* sGoalOpName, IFunctionHandler* pH, int nFirstParam, GoalParameters& params) const;
  53.  
  54.         IGoalOp* GetGoalOp(EGoalOperations op, GoalParameters& params) const;
  55.  
  56.         /** Add a factory to the ordering. */
  57.         void AddFactory(IGoalOpFactory* pFactory);
  58.  
  59.         /** Reserve space for factories. */
  60.         void PrepareForFactories(size_t count);
  61.  
  62.         /**
  63.          * Destroy all factories in the ordering.
  64.          * Result is is an empty ordering.
  65.          */
  66.         void DestroyAll(void);
  67.  
  68. protected:
  69.         typedef std::vector<IGoalOpFactory*> TFactoryVector;
  70.         TFactoryVector m_Factories;
  71. };
  72.  
  73. #endif  // __GoalOpFactory_H__
  74.  
downloadGoalOpFactory.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top