VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
luaScriptInterfaceImpl.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
7 #include <vrfLua/vrfLuaDefines.h>
8 #include <vrfLua/luaFeatureSet.h>
9 #include <vrfLua/luaPathJob.h>
10 
13 #include "vrfutil/scriptGeometry.h"
15 #include <luabind/luabind.hpp>
18 #include <vrfutil/objectCounter.h>
19 
20 #include <lua.hpp>
21 #include <lauxlib.h>
22 #include <lualib.h>
23 
24 #include <boost/signals2.hpp>
25 
26 namespace makVrfEvents
27 {
28  class DtEvent;
29  class DtInfluenceEvent;
30 }
31 
33 
38 typedef luabind::object (*ReaderWriterToLuaTableFcn)(lua_State* LS, const DtReaderWriter* rwString,
39  const DtSimulationServices* mgr, const DtString& parameterType);
40 
41 const char ContactObservedOnly[] = "observedOnly";
42 const char ContactAliveOnly[] = "aliveOnly";
43 const char ContactHostileOnly[] = "hostileOnly";
44 const char ContactCurrentlyDetectedOnly[] = "currentlyDetectedOnly";
45 
50  : public DtScriptInterface
51 #ifdef DtObjectDebugger_Enable
52  , public DtObjectDebugger<DtLuaScriptInterfaceImpl>
53 #endif
54 {
55 protected:
57 
60 
61 public:
62  virtual ~DtLuaScriptInterfaceImpl();
63 
64  static DtScriptInterface* creator(DtSimulationServices*);
65 
66  virtual void init();
67 
68  virtual DtString type() const;
69 
70  virtual bool invokeInit();
71  virtual void invokeSuspend();
72  virtual bool invokeResume();
73  virtual void invokeTick();
74  virtual bool invokeCheck();
75  virtual void invokeCheckInit();
76  virtual void invokeShutdown();
77  virtual void invokeUpdateDisplayGraph();
78 
81  virtual void invokeDisable();
82 
83  virtual bool loadScript(bool reload);
84 
85  virtual void setLuaState(lua_State* L);
86  virtual lua_State* getLuaState();
87 
88  virtual std::string dumpLuaStack() const;
89  virtual int luaStackSize() const;
90  virtual void collectGarbage();
91 
92  virtual DtReaderWriter* saveState();
93  virtual bool loadState(const DtReaderWriter* loadState);
94  virtual void processClearForReuse();
95 
100  static void addLuaScriptInterfaceExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension, void* usr);
101 
106  static void addLuaScriptInterfaceExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension,
107  const DtLocalObject* onlyForEntity, void* usr);
108 
110  static void removeLuaScriptInterfaceExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension, void* usr);
111 
114  static void removeLuaScriptInterfaceExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension,
115  const DtLocalObject* onlyForEntity, void* usr);
116 
117  virtual bool initializeVRFLuaExtensions(lua_State* L);
118  virtual bool importTaskParams(lua_State* L);
119 
121  virtual bool importSetParams(lua_State* L);
122 
124  virtual luabind::object createLuaTableFromRegistry(lua_State* L, const DtReaderWriterRegistry& rwRegistry, bool requireMetadata = true, bool hasParamMetaData = true);
125 
127  static void addKeyToIgnore(const std::string&);
128 
130  static void removeKeyToIgnore(const std::string&);
131 
133  void luaEndTask(bool success);
134  void luaEndSet();
135 
137 
139 
140  virtual void luaPlayScenarioEvent(DtScriptVrfObject eventName);
141  virtual void luaStopScenarioEvent(DtScriptVrfObject eventName);
142  virtual void luaStopScenarioEventWithRewind(DtScriptVrfObject eventName, bool rewind);
143  virtual bool luaIsScenarioEventPlaying(DtScriptVrfObject eventName);
144  virtual void luaSetScenarioEventEnabled(DtScriptVrfObject eventName, bool);
145  virtual bool luaIsScenarioEventEnabled(DtScriptVrfObject eventName);
147 
149 
150  virtual int luaSendEmbeddedEntityTask(std::string eeName, std::string taskName, luabind::object const& parms);
152  virtual int luaSendEmbeddedEntityTaskActAsSubtask(std::string eeName, std::string taskName,
153  luabind::object const& parms, bool actAsSubtask);
155  virtual int luaSendEmbeddedEntitySet(std::string eeName, std::string setName, luabind::object const& parms);
157 
159 
160  int luaStartSubtask(const std::string taskName, luabind::object const& parameters);
162  void luaStopSubtask(int subtaskId);
164  void luaStopAllSubtasks();
166  bool luaIsSubtaskRunning(int subtaskId);
168  bool luaIsSubtaskComplete(int subtaskId);
170  bool luaIsSubtaskCanceled(int subtaskId);
172  bool luaSubtaskResult(int subtaskId);
176  void luaCleanupInactiveSubtaskStatus();
178 
180  void luaSendReportWithoutRecipients(const::std::string reportType,
181  luabind::object const& parameters);
182  void luaSendReport(const::std::string reportType,
183  luabind::object const& reciptients,
184  luabind::object const& parameters);
185 
187  int luaSendTask(DtScriptVrfObject& object, const::std::string taskName,
188  luabind::object const& parameters);
189  int luaSendTaskActAsSubtask(DtScriptVrfObject& object, const::std::string taskName,
190  luabind::object const& parameters, bool actAsSubtask);
191  int luaSendRadioTask(DtScriptVrfObject& object, const::std::string taskName,
192  luabind::object const& parameters);
193  int luaSendRadioTaskActAsSubtask(DtScriptVrfObject& object, const::std::string taskName,
194  luabind::object const& parameters, bool actAsSubtask);
195  int luaSendTaskActAsSubtaskWithRadio(DtScriptVrfObject& object, const::std::string taskName,
196  luabind::object const& parameters, bool actAsSubtask, bool sendWithRadio);
197 
199  void luaStopAllTasks();
200 
202  void luaSendSetDataToSelf(const::std::string setName,
203  luabind::object const& parameters);
204 
206  void luaSendSetData(DtScriptVrfObject& object, const::std::string setName,
207  luabind::object const& parameters);
208  void luaSendRadioSetData(DtScriptVrfObject& object, const::std::string setName,
209  luabind::object const& parameters);
210  void sendSetDataWithRadio(DtScriptVrfObject& object, const::std::string setName,
211  luabind::object const& parameters, bool useRadio);
212 
213  bool luaIsTaskAvailable(const::std::string taskName);
214  bool luaIsSetAvailable(const::std::string setName);
215 
217  luabind::object luaGetReactionStatus();
218 
227  luabind::object luaGetOrbatList();
228 
230  std::string luaGetScriptId();
231 
233  std::string luaGetSystemName();
234 
235  luabind::object luaGetObjectsNear(const DtLocation3D& loc, double distance);
236  luabind::object luaGetObjectsNearWithFilter(const DtLocation3D& loc, double distance, luabind::object const& parameters);
237 
238  luabind::object luaGetScriptAttribute(const std::string& attributeName, bool& error);
239 
241  luabind::object luaGetVrfObjects();
242 
244 
245  luabind::object luaGetDesignatorsNearWithFilter(const DtLocation3D& loc, double distance,
246  const luabind::object& params);
247 
248  luabind::object luaGetDesignatorsNear(const DtLocation3D& loc, double distance);
250 
252 
253  DtLuaFeatureSet luaGetFeaturesWithinArea(luabind::object const& points, luabind::object const& attributes);
256  DtLuaFeatureSet luaGetFeaturesWithinAreaNoAttributes(luabind::object const& points);
257 
260  DtLuaFeatureSet luaGetFeaturesWithinRange(const DtLocation3D&, double range, luabind::object const& attributes);
262  DtLuaFeatureSet luaGetFeaturesWithinRangeNoAttributes(const DtLocation3D&, double range);
263 
265  DtLuaFeatureSet luaGetFeaturesType(const std::string& type);
267  DtLuaFeatureSet luaGetFeatures();
269 
271 
272  DtLuaFeatureGeometry luaMakePointGeometry(const DtLocation3D&);
275  DtLuaFeatureGeometry luaMakePathGeometry(luabind::object const& table);
277  DtLuaFeatureGeometry luaMakeAreaGeometry(luabind::object const& table);
279 
281  boost::shared_ptr<DtLuaAsyncJob> generateRandomPoints(const luabind::object& parameters);
282 
284  boost::shared_ptr<DtLuaAsyncJob> findNearbyPointOfInterest(const int type);
285 
287  boost::shared_ptr<DtLuaAsyncJob> findCoverPoint(
288  const DtLocation3D& startLocation, const DtLocation3D& threatLocation,
289  double threatRadius, double distanceFromThreat, double range, unsigned numberOfPoints);
290 
292  luabind::object findLadders(lua_State* L, const DtLocation3D& startLocation, double range);
294  luabind::object findLaddersWithId(lua_State* L, const DtLocation3D& startLocation, double range, const unsigned int id);
295 
297  boost::shared_ptr<DtLuaAsyncJob> findPathToLocation(
298  const DtLocation3D& startLocation, const DtLocation3D& destinationLocation,
299  bool useAbstractGraphs, const DtLocation3D& avoidLocation, double avoidanceRadius);
300 
302  DtTranslatableStream translateStringFromScript(const std::string& format);
303 
306  boost::shared_ptr<DtLuaAsyncJob> luaNavigateThroughFeatures(const luabind::object& parameters);
307 
310  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindHighPoints(const luabind::object& corners, unsigned int nPoints);
311  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindHighPointsDebug(const luabind::object& corners, unsigned int nPoints, bool bDebug);
313 
315  /*
316  job = vrf:luaFindSinglePosition(taskParameters.targetArea:getLocations3D(),
317  taskParameters.battlePosition,
318  targetHeightMeters, -- 2/3 vehicle height, for example.
319  double viewHeightMeters, -- 2/3 vehicle height, for example.
320  double hideHeightMeters, -- 1.1x vehicle height, for example.
321  double forwardBackSearchLimitMeters, -- 50m forward + 50m backward = 100m
322  double forwardBackSearchIntervalMeters, -- half vehicle length, for example.
323  double maxSlopeDegrees, -- *todo add comments*
324  )
325  )
326 
327  */
328  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindSinglePosition(const luabind::object& targetAreaCorners,
329  const DtLocation3D& pivotPoint,
330  double targetHeightMeters,
331  double viewHeightMeters,
332  double hideHeightMeters,
333  double forwardBackSearchLimitMeters,
334  double forwardBackSearchIntervalMeters,
335  double maxSlopeDegrees);
336 
338  /*
339  job = vrf:luaFindSinglePosition(taskParameters.targetArea:getLocations3D(),
340  taskParameters.battlePosition,
341  targetHeightMeters, -- 2/3 vehicle height, for example.
342  double viewHeightMeters, -- 2/3 vehicle height, for example.
343  double hideHeightMeters, -- 1.1x vehicle height, for example.
344  double forwardBackSearchLimitMeters, -- 50m forward + 50m backward = 100m
345  double forwardBackSearchIntervalMeters, -- half vehicle length, for example.
346  double maxSlopeDegrees, -- *todo add comments*
347  bool bDebug -- Log additional information)
348  )
349  */
350  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindSinglePositionDebug(const luabind::object& targetAreaCorners,
351  const DtLocation3D& pivotPoint,
352  double targetHeightMeters,
353  double viewHeightMeters,
354  double hideHeightMeters,
355  double forwardBackSearchLimitMeters,
356  double forwardBackSearchIntervalMeters,
357  double maxSlopeDegrees,
358  bool bDebug);
359 
360 
362  /*
363  job = vrf:findVehicleFightingPositions(taskParameters.numberOfPoints,
364  taskParameters.targetArea:getLocations3D(),
365  taskParameters.battlePosition,
366  maxVolume, -- half dimensions of hide position
367  maxVolume:getUp() * 0.67, --67% of total height for shooting height
368  maxVolume:getUp() * 0.50, -- half height for target height
369  searchWidthForward, -- how much forward and back to search forward and back
370  searchWidthSide -- how much side to side to search
371  positionSpacing -- how many meters between postions, side to side
372  )
373  */
374  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindVehicleFightingPositions(unsigned int nPositionPairs,
375  const luabind::object& targetAreaCorners,
376  const DtLocation3D& originPoint,
377  const DtVectorOffset3D& hideVolume,
378  double shootHeight,
379  double targetHeight,
380  double forwardBackSearchLimit,
381  double sideSideSearchLimit,
382  double maxSlopeDegrees,
383  double positionSpacing);
384 
386  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindVehicleFightingPositionsDebug(unsigned int nPositionPairs,
387  const luabind::object& targetAreaCorners,
388  const DtLocation3D& originPoint,
389  const DtVectorOffset3D& hideVolume,
390  double shootHeight,
391  double targetHeight,
392  double forwardBackSearchLimit,
393  double sideSideSearchLimit,
394  double maxSlopeDegrees,
395  double positionSpacing,
396  bool useDebug);
397 
398  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaHilltop(unsigned int nPositionPairsPerGroup,
399  const luabind::object& searchAreaVertices,
400  const luabind::object& targetsAreaVertices,
401  double viewHeightMeters,
402  double coverHeightMeters,
403  unsigned int forwardBackRangeMeters,
404  unsigned int sideSideRangeMeters,
405  unsigned int searchIntervalMeters,
406  double maxSlopeDegrees,
407  unsigned int positionsLateralSpacingMeters);
408 
409  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaHilltopDebug(unsigned int nPositionPairsPerGroup,
410  const luabind::object& searchAreaVertices,
411  const luabind::object& targetsAreaVertices,
412  double viewHeightMeters,
413  double coverHeightMeters,
414  unsigned int forwardBackRangeMeters,
415  unsigned int sideSideRangeMeters,
416  unsigned int searchIntervalMeters,
417  double maxSlopeDegrees,
418  unsigned int positionsLateralSpacingMeters,
419  bool useDebug);
420 
421  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaRidge(unsigned int nPositionPairsPerGroup,
422  const luabind::object& searchAreaVertices,
423  const luabind::object& targetsAreaVertices,
424  unsigned int targetsAreaSampleRate,
425  const luabind::object& tableOfDoubles
426  );
427 
428  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaRidgeDebug(unsigned int nPositionPairsPerGroup,
429  const luabind::object& searchAreaVertices,
430  const luabind::object& targetsAreaVertices,
431  unsigned int targetsAreaSampleRate,
432  const luabind::object& tableOfDoubles
433  , bool useDebug);
434 
437  boost::shared_ptr<DtLuaAsyncJob> getAllEmbarkationSlots(DtScriptVrfObject& object);
438 
441  boost::shared_ptr<DtLuaAsyncJob> getEmbarkationSlots(DtScriptVrfObject& object);
442 
444  boost::shared_ptr<DtLuaAsyncJob> getEmbarkationSlotsFiltered(DtScriptVrfObject& object,
445  bool bAllSlots);
446 
448  boost::shared_ptr<DtLuaAsyncJob> reserveEmbarkationSlot(DtScriptVrfObject& object, int slotNumber);
449 
451  boost::shared_ptr<DtLuaAsyncJob> getEmbarkationEgressPoints(DtScriptVrfObject& object);
452 
453  void luaSendMessage(const DtScriptVrfObject& receiver, const std::string& message);
454  void luaSendRadioMessage(const DtScriptVrfObject& receiver, const std::string& message);
455  void luaSendRadioMessageToUuid(const std::string& uuid, const std::string& message);
456  void luaDeleteObject(std::string const& receiver);
457  void luaDeleteScriptObject(const DtScriptVrfObject& receiver);
458  void luaSetInterest(const DtLocation3D& location, double range);
459 
460  void luaSendObjectMessage(const DtScriptVrfObject& receiver, const std::string& messageType, const luabind::object& messageContents);
461  void luaSendRadioObjectMessage(const DtScriptVrfObject& receiver, const std::string& messageType, const luabind::object& messageContents);
462  void luaRegisterForObjectMessage(const std::string& messageType);
463  void luaUnregisterForObjectMessage(const std::string& messageType);
464  void processObjectMessage(const DtVrfObjectMessage* msg);
465 
466  static void textReportCallback(const DtVrfObjectMessage* m, void* usr);
467  virtual void queueTextReport(const DtVrfObjectMessage* m);
468  virtual void processTextReport(const DtVrfObjectMessage* m);
469 
470  void luaSendInfluence(const DtScriptVrfObject& target,
471  const std::string& influenceName, luabind::object const& influenceParams);
472 
474  static void addReaderWriterToLuaTableFunction(const DtString&, ReaderWriterToLuaTableFcn);
475 
476  static void influenceEventCallback(DtBoost::shared_ptr<const makVrfEvents::DtInfluenceEvent> event, void* usr);
477  virtual void queueInfluence(DtBoost::shared_ptr<const makVrfEvents::DtInfluenceEvent> e);
478  virtual void processInfluence(DtBoost::shared_ptr<const makVrfEvents::DtInfluenceEvent> e);
479 
481  virtual void processEntityDestroyed();
482 
484  luabind::object luaGetCloudLayerDescriptionsAt(lua_State *L, const DtLocation3D& location);
487 
490 
491  virtual double luaGetIllumination(DtScriptVrfObject& object);
492  virtual double luaGetExpectedIllumination(DtScriptVrfObject& object, double dateAndTimeOfDay);
493  virtual double luaGetSnowAccumulationByLocation(const DtLocation3D& object);
494  virtual double luaGetSnowRoadAccumulationByLocation(const DtLocation3D& object);
495  virtual double luaGetRainAccumulationByLocation(const DtLocation3D& object);
496 
497  virtual double luaGetAirTemperatureByLocation(const DtLocation3D& object);
498  virtual double luaGetAirPressureByLocation(const DtLocation3D& object);
499  virtual unsigned int luaGetPrecipitationByLocation(const DtLocation3D& location, double*);
500  virtual double luaGetPrecipitationIntensityByLocation(const DtLocation3D& object);
501  virtual unsigned int luaGetPrecipitationTypeByLocation(const DtLocation3D& object);
502  virtual double luaGetVisibilityDistanceByLocation(const DtLocation3D& object);
503  virtual int luaGetVisibilityObscurantByLocation(const DtLocation3D& object);
504  virtual double luaGetWindDirectionByLocation(const DtLocation3D& object);
505  virtual double luaGetWindSpeedByLocation(const DtLocation3D& object);
506  virtual double luaGetUnderwaterVisibilityByLocation(const DtLocation3D& object);
507  virtual unsigned int luaGetSwellStateByLocation(const DtLocation3D& object);
508  virtual double luaGetSwellStateDirectionByLocation(const DtLocation3D& object);
509  virtual unsigned int luaGetSeaStateByLocation(const DtLocation3D& object);
510  virtual double luaGetSeaStateDirectionByLocation(const DtLocation3D& object);
511  virtual double luaGetSurgeDepthByLocation(const DtLocation3D& object);
512  virtual double luaGetIlluminationByLocation(const DtLocation3D& object);
513  virtual double luaGetExpectedIlluminationByLocation(const DtLocation3D& object, double dateAndTimeOfDay);
515 
518  virtual double luaRunDurationTime();
519  virtual void luaRunForDuration(double);
520  virtual void luaStopSimulationDurationTimer();
522 
525  virtual void luaSetCheckpointMode(bool);
526  virtual void initializeCheckpointStateTable(lua_State* L);
527 
536  virtual int luaAskUserQuestion(const DtTranslatableStream& title, const DtTranslatableStream& message,
537  luabind::object const& options, int displayFlags);
538  virtual int luaAskUserQuestionST(const std::string& title, const DtTranslatableStream& message,
539  luabind::object const& options, int displayFlags);
540  virtual int luaAskUserQuestionTS(const DtTranslatableStream& title, const std::string& message,
541  luabind::object const& options, int displayFlags);
542  virtual int luaAskUserQuestionSS(const std::string& title, const std::string& message,
543  luabind::object const& options, int displayFlags);
544 
548  virtual int luaStatusOfUserQuestion(int questionId);
549 
551  virtual void luaCancelUserQuestion(int questionId);
552 
556 
558  DtScriptVrfObject luaCreateEntity(luabind::object const& parameters);
559  void luaCreateEntityParallel(luabind::object const& parameters);
560 
562  DtScriptVrfObject luaCreateFromOrbat(std::string orbatItem, const DtLocation3D& loc);
563 
565  DtScriptVrfObject luaCreateTacticalGraphic(luabind::object const& parameters);
566 
568  DtScriptVrfObject luaCreateObstacle(luabind::object const& parameters);
569 
571  DtScriptVrfObject luaCreateRoute(luabind::object const& parameters);
572 
574  DtScriptVrfObject luaCreateArea(luabind::object const& parameters);
575 
577  DtScriptVrfObject luaCreateWaypoint(luabind::object const& parameters);
578 
580  DtScriptVrfObject luaCreatePhaseLine(luabind::object const& parameters);
582 
584  virtual std::vector<DtLocation3D> luaMakeOffsetPoints(luabind::object const& fromPoints,
585  const DtVectorOffset3D& offset);
586 
588  void luaCreateSelectionGroup(const std::string& name, luabind::object const& parameters);
589 
593  void luaFinishTest(const int status, const std::string message);
594 
596  bool luaUpdateTaskVisualization(const std::string& visualizationName,
597  const std::string& visualizationType, luabind::object const& parameters);
598 
600  void luaDeleteTaskVisualization(const std::string& visualizationName);
601 
603  void luaRequire(lua_State* L, const std::string& filename);
604 
607  unsigned luaBitwiseOr(unsigned val1, unsigned val2);
608  unsigned luaBitwiseAnd(unsigned val1, unsigned val2);
609  unsigned luaBitwiseXor(unsigned val1, unsigned val2);
610  unsigned luaBitwiseNot(unsigned val);
611  unsigned luaBitwiseLeftShift(unsigned val, unsigned shift);
612  unsigned luaBitwiseRightShift(unsigned val, unsigned shift);
614 
615  bool luaIntersectSegments2D(const DtLocation3D& p1, const DtLocation3D& p2, const DtLocation3D& p3, const DtLocation3D& p4,
616  DtLocation3D& intersectPoint);
617 
622  {
623  public:
624  DtLuaScriptFunctionReference(const std::string& functionName)
626  , myFunctionName(functionName)
627  {
628 
629  }
630 
632  {
633 
634  }
635 
636  std::string functionName() const
637  {
638  return myFunctionName;
639  }
640 
641  virtual bool operator<(const DtScriptFunctionReference& other) const
642  {
643  try
644  {
645  const DtLuaScriptFunctionReference& rhs =
646  dynamic_cast<const DtLuaScriptFunctionReference&>(other);
647  return myFunctionName.compare(rhs.myFunctionName) < 0;
648  }
649  catch(...)
650  {
651  DtInfo << "DtLuaScriptFunctionReference::operator< attempt to compare with wrong type.\n";
652  return false;
653  }
654  }
655 
656  protected:
657  std::string myFunctionName;
658  };
659 
662  virtual void addPostSetDataCallback(const std::string& setDataType,
663  const std::string& functionName);
666  virtual void removePostSetDataCallback(const std::string& setDataType,
667  const std::string& functionName);
668 
671  virtual void invokePostSetDataCallback(
672  DtScriptFunctionReferencePtr functionReference,
673  DtSetDataRequestMessage* setDatRequest);
674 
680  virtual luabind::object luaGetParamPropertyFromType(
681  const std::string typeString, std::string const& paramName);
682 
684  virtual void putObjectsFromTableIntoGlobalTable(lua_State* state, luabind::object& table);
685  virtual void putObjectsFromGlobalTableIntoTable(lua_State* state, luabind::object& table);
686 
688  virtual luabind::object luaGetSubordinateFunctionNames();
689 
691  virtual luabind::object luaGetParameterSubordinateFunctionsFromType(
692  const std::string typeString);
693 
694 
695  virtual void connectForCallbacks();
696  virtual void processEvents();
697 
699  boost::shared_ptr<DtLuaAsyncJob> luaGetWeaponSystemsInfo(DtScriptVrfObject& object);
700 
701 protected:
705  virtual bool callLuaNoArgFunction(const std::string& functionName, bool* functionExists = 0);
706 
707  virtual void updateFuncCallCount();
708 
709  lua_State* myLState;
710  unsigned myFuncCallCount;
712 
713  typedef std::vector<DtLuaScriptInterfaceExtension*> LocalInterfaceExtensions;
715 
717  {
718  LuaExtension() : creator(0), onlyForEntity(0), usr(0) {};
719  LuaExtension(const LuaExtension& orig) : creator(orig.creator), onlyForEntity(orig.onlyForEntity),
720  usr(orig.usr) {};
721 
724  void* usr;
725  };
726 
727  typedef std::vector<LuaExtension> GlobalInterfaceExtensions;
728 
730 
731  luabind::object* myCheckpointStateTable;
732 
733  typedef std::map<DtString, ReaderWriterToLuaTableFcn> ReaderWriterToLuaTableMap;
736 
737  std::vector<DtVrfObjectMessage*> myTextReportCallbacks;
738  std::vector<DtBoost::shared_ptr<const makVrfEvents::DtInfluenceEvent> > myInfluenceEvents;
739 };
740 
742 
750 namespace luaScriptInterface
751 {
752  typedef luabind::object (*rwToLuaBindObjectFcn)(
753  const DtReaderWriter* rw, lua_State* L);
754 
755  luabind::object luaGetEntityParam(lua_State* L,
756  const DtScriptVrfObject& entity, std::string const& paramName);
757 
758  luabind::object luaGetSystemAttribute(
759  const DtScriptComponentSystem& system, const std::string& attributeName
760  , bool *error
761  , lua_State *L
762  );
763 
765  luabind::object luaGetContactInfo(lua_State* L, const DtScriptOwnshipObject& thisEntity,
766  const DtScriptVrfObject& otherEntity);
767 
771  luabind::object luaGetSubordinateFormation(lua_State* L,
772  const DtScriptOwnshipObject& entity,
773  DtScriptVrfObject& leadSubordinate);
774 
782  std::list<DtVectorOffset3D> luaGetOptionFormationPositions(lua_State* L,
783  const DtScriptVrfObject& unit,
784  const std::string& formationName, luabind::object const& options,
785  int* leaderIndex);
786 
788  std::list<DtVectorOffset3D> luaGetFormationPositions(lua_State* L,
789  const DtScriptVrfObject& unit,
790  const std::string& formationName,
791  int* leaderIndex);
792 
795  luabind::object luaGetParameterSubordinateFunctions(lua_State* L, const DtScriptVrfObject& entity);
796 
798  luabind::object luaGetSubordinateFunctions(lua_State* L, const DtScriptVrfObject& entity);
799 
803  bool luaSetSubordinateFunctions(lua_State* L, const DtScriptVrfObject& entity, luabind::object const& subsAndFunctions);
804 
806  std::string luaGetSubordinateFunction(lua_State* L, const DtScriptVrfObject& entity, const DtScriptVrfObject& subEntity);
807 
811  bool luaSetSubordinateFunction(lua_State* L, const DtScriptVrfObject& entity, const DtScriptVrfObject& subEntity, const std::string& subFunction);
812 
814  luabind::object luaGetTargetPriorityList(lua_State* L, const DtScriptOwnshipObject& thisEntity);
815 
823  std::list<DtScriptVrfObject> luaGetContactsWithFilter(
824  lua_State* L, const DtScriptOwnshipObject& entity,
825  luabind::object const& typeFilters, bool observedOnly);
828  std::list<DtScriptVrfObject> luaGetContactsWithFilterAliveOnly(
829  lua_State* L, const DtScriptOwnshipObject& entity,
830  luabind::object const& typeFilters, bool observedOnly,
831  bool aliveOnly);
832 
835  std::list<DtScriptVrfObject> luaGetHostileContactsWithFilterAliveOnly(
836  lua_State* L, const DtScriptOwnshipObject& entity,
837  luabind::object const& typeFilters, bool observedOnly,
838  bool aliveOnly);
839 
844  std::list<DtScriptVrfObject> luaGetContacts(
845  lua_State* L, const DtScriptOwnshipObject& entity,
846  luabind::object const& typeFilters,
847  luabind::object const& flags);
848 
851  bool luaSetStateProperty(lua_State* L, DtScriptOwnshipObject& entity,
852  const std::string& propertyName, luabind::object const& prop);
853 
857  bool luaSetOrAddStateProperty(lua_State* L, DtScriptOwnshipObject& entity,
858  const std::string& propertyName, luabind::object const& prop, bool addIfNotFound);
859 
866  bool luaSetStatePropertyListItem(lua_State* L,
867  DtScriptOwnshipObject& entity, const std::string& propertyName,
868  luabind::object const& keyValues, luabind::object const& itemValue);
869 
876  lua_State* L, DtScriptOwnshipObject& entity, const std::string& propertyName,
877  int index, luabind::object const& itemValue);
878 
885  bool luaSetStatePropertyMapItem(lua_State* L,
886  DtScriptOwnshipObject& entity, const std::string& propertyName,
887  luabind::object const& keyValue, luabind::object const& itemValue);
888 
893  luabind::object luaGetStateProperty(lua_State* L,
894  const DtScriptVrfObject& entity, const std::string& propertyName);
895  luabind::object luaGetStateOwnshipProperty(lua_State* L,
896  const DtScriptOwnshipObject& entity, const std::string& propertyName);
897 
906  luabind::object luaGetStatePropertyListItem(lua_State* L,
907  const DtScriptVrfObject& entity, const std::string& propertyName,
908  luabind::object const& keyValues, int& index);
909  luabind::object luaGetStateOwnshipPropertyListItem(lua_State* L,
910  const DtScriptOwnshipObject& entity, const std::string& propertyName,
911  luabind::object const& keyValues, int& index);
912 
920  luabind::object luaGetStatePropertyListItemByIndex(lua_State* L,
921  const DtScriptVrfObject& entity, const std::string& propertyName,
922  int index);
923  luabind::object luaGetStateOwnshipPropertyListItemByIndex(lua_State* L,
924  const DtScriptOwnshipObject& entity, const std::string& propertyName,
925  int index);
926 
934  luabind::object luaGetStatePropertyMapItem(lua_State* L,
935  const DtScriptVrfObject& entity, const std::string& propertyName,
936  luabind::object const& keyValue);
937  luabind::object luaGetStateOwnshipPropertyMapItem(lua_State* L,
938  const DtScriptOwnshipObject& entity, const std::string& propertyName,
939  luabind::object const& keyValue);
940 
945  luabind::object luaGetParamProperty(lua_State* L,
946  const DtScriptVrfObject& entity, std::string const& paramName);
947  luabind::object luaGetOwnshipParamProperty(lua_State* L,
948  const DtScriptOwnshipObject& entity, std::string const& paramName);
949 
958  luabind::object luaGetParameterPropertyListItem(lua_State* L,
959  const DtScriptVrfObject& entity, const std::string& propertyName,
960  luabind::object const& keyValues, int& index);
961  luabind::object luaGetOwnshipParameterPropertyListItem(lua_State* L,
962  const DtScriptOwnshipObject& entity, const std::string& propertyName,
963  luabind::object const& keyValues, int& index);
964 
972  luabind::object luaGetParameterPropertyListItemByIndex(lua_State* L,
973  const DtScriptVrfObject& entity, const std::string& propertyName,
974  int index);
975  luabind::object luaGetOwnshipParameterPropertyListItemByIndex(lua_State* L,
976  const DtScriptOwnshipObject& entity, const std::string& propertyName,
977  int index);
978 
986  luabind::object luaGetParameterPropertyMapItem(lua_State* L,
987  const DtScriptVrfObject& entity, const std::string& propertyName,
988  luabind::object const& keyValue);
989  luabind::object luaGetOwnshipParameterPropertyMapItem(lua_State* L,
990  const DtScriptOwnshipObject& entity, const std::string& propertyName,
991  luabind::object const& keyValue);
992 
994  DtScriptComponentSystem& system, const std::string& attributeName,
995  const luabind::object & value,
996  lua_State *L);
997 
998  static const std::map<DtString, rwToLuaBindObjectFcn>& rwToLuaBindObjectMap();
999 };
virtual void invokePostSetDataCallback(DtScriptFunctionReferencePtr functionReference, DtSetDataRequestMessage *setDatRequest)=0
Implement to invoke the function referenced by functionReference. setDatRequest contains the informat...
virtual bool operator<(const DtScriptFunctionReference &other) const
Required for std::set.
Definition: luaScriptInterfaceImpl.h:641
virtual void processEntityDestroyed()
Can be overridden to perform some processing when the entity is destroyed.
Definition: scriptInterface.h:199
std::vector< DtVrfObjectMessage * > myTextReportCallbacks
Definition: luaScriptInterfaceImpl.h:737
virtual void addPostSetDataCallback(const DtSetMessageType &setDataType, DtScriptFunctionReferencePtr functionReference)
Adds a callback to be invoked after the specified type of set data request is executed.
virtual bool invokeInit()=0
luabind::object luaGetParameterPropertyListItemByIndex(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, int index)
Returns an object containing the value of the of an item in the given parameter property. The property must be a list. Returns the item at the given index, using the Lua convention that the first item is at index 1. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty.
std::list< DtScriptVrfObject > luaGetContactsWithFilterAliveOnly(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly, bool aliveOnly)
Same as luaGetContactsWithFiler but adds a boolean flag to indicate that only non-destroyed entities ...
luabind::object luaGetParamProperty(lua_State *L, const DtScriptVrfObject &entity, std::string const &paramName)
Returns an object containing the value of the requested parameter property. May be a table containing...
const char ContactObservedOnly[]
Definition: luaScriptInterfaceImpl.h:41
luabind::object * myCheckpointStateTable
Definition: luaScriptInterfaceImpl.h:731
luabind::object luaGetSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity)
Return a table of {{&quot;subordinate&quot; = DtScriptVrfObject, &quot;function&quot; = string}}.
static GlobalInterfaceExtensions theLuaInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:729
std::vector< LuaExtension > GlobalInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:727
lua_State * myLState
Definition: luaScriptInterfaceImpl.h:709
virtual bool invokeResume()=0
luabind::object luaGetStateOwnshipPropertyListItemByIndex(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, int index)
virtual bool loadState(const DtReaderWriter *savedState)=0
Called when the scenario is loaded. The load state pointer may not be valid, which does not indicate ...
bool luaSetSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity, luabind::object const &subsAndFunctions)
Given a table of {{&quot;subordinate&quot; = DtScriptVrfObject, &quot;function&quot; = string}} Set the state propert...
luabind::object luaGetStateOwnshipPropertyMapItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue)
unsigned myFuncCallCount
Definition: luaScriptInterfaceImpl.h:710
luabind::object luaGetSubordinateFormation(lua_State *L, const DtScriptOwnshipObject &entity, DtScriptVrfObject &leadSubordinate)
Gets a table indexed by simObject (subordinates) of position offset relative to the formation leader...
virtual void invokeCheckInit()=0
luabind::object luaGetParameterPropertyListItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
Returns an object containing the value of the of an item in the given parameter property. The property must be a list. The item returned will have values matching the specified key values in the key fields. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty. Sets index to be the index of the item, using the Lua convention that the first item is at index 1.
Definition: readerWriter.h:85
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:265
Default on in debug, off in release.
Definition: objectCounter.h:31
luabind::object(* ReaderWriterToLuaTableFcn)(lua_State *LS, const DtReaderWriter *rwString, const DtSimulationServices *mgr, const DtString &parameterType)
When adding decoder functions to turn reader/writer into lua tables, the format must be of the follow...
Definition: luaScriptInterfaceImpl.h:38
bool luaSetStatePropertyListItemByIndex(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, int index, luabind::object const &itemValue)
Finds the item in the list at the specified index and updates it to the new value. If the list is not long enough, new entries are added. Any items added in this way will be given the same value as the new entry. If the property does not exist or the format of the data is incorrect, returns false.
virtual void removePostSetDataCallback(const DtSetMessageType &setDataType, DtScriptFunctionReferencePtr functionReference)
Remove a callback invoked after the specified type of set data request is executed.
Definition: readerWriterRegistry.h:39
virtual DtReaderWriter * saveState()=0
Called when the scenario is saved. The stateState pointer may not be valid, in which case something w...
luabind::object luaGetStatePropertyListItemByIndex(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, int index)
Returns an object containing the value of the of an item in the given state property. The state property must be a list. Returns the item at the given index, using the Lua convention that the first item is at index 1. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty.
LocalInterfaceExtensions myInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:714
virtual bool loadScript(bool reload=false)=0
This will be called by the parent to let the interface know when to load the script.
bool myLuaScriptWarningShown
Definition: luaScriptInterfaceImpl.h:711
static ReaderWriterToLuaTableMap theReaderWriterToLuaTableMap
Definition: luaScriptInterfaceImpl.h:734
luabind::object luaGetParameterSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity)
Gets a table of entity type and subordinate function handle pairs {{ENTITY_TYPE_STRING, FUNCTION_HANDLE_STRING}}.
std::list< DtScriptVrfObject > luaGetContactsWithFilter(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly)
This function supports the script API. It gets the list of contacts matching the given filter and ret...
std::string functionName() const
Definition: luaScriptInterfaceImpl.h:636
DtLuaScriptFunctionReference(const std::string &functionName)
Definition: luaScriptInterfaceImpl.h:624
luabind::object luaGetStatePropertyMapItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValue)
Returns an object containing the value of the of an item in the given state property. The state property must be a map. The item returned will have values matching the specified key value. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or map item could not be found, the returned table will be empty.
VectorOffset3D is a direction vector that is relative to some direction specified by a Vector3D...
Definition: scriptGeometry.h:424
Handles translation of messages from C++ structures into Lua tables and the reverse translation as we...
Definition: luaMessageInterface.h:23
luabind::object luaGetOwnshipParamProperty(lua_State *L, const DtScriptOwnshipObject &entity, std::string const &paramName)
std::string luaGetSubordinateFunction(lua_State *L, const DtScriptVrfObject &entity, const DtScriptVrfObject &subEntity)
Return a string representing subordinate function for indicated subordinate.
LuaExtension(const LuaExtension &orig)
Definition: luaScriptInterfaceImpl.h:719
bool luaSetStatePropertyMapItem(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue, luabind::object const &itemValue)
Sets a single item in a map state property to the given value. First looks in the map to see if any e...
virtual DtString type() const =0
Script engine type.
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
Represents a feature geometry.
Definition: luaFeatureGeometry.h:25
luabind::object luaGetStateOwnshipPropertyListItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
static const std::map< DtString, rwToLuaBindObjectFcn > & rwToLuaBindObjectMap()
const DtLocalObject * onlyForEntity
Definition: luaScriptInterfaceImpl.h:723
Definition: luaScriptInterfaceImpl.h:49
luabind::object luaGetOwnshipParameterPropertyListItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
bool luaSetStateProperty(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &prop)
Sets the specified state property with the given value. If the property does not exist or the format ...
luabind::object luaGetSystemAttribute(const DtScriptComponentSystem &system, const std::string &attributeName, bool *error, lua_State *L)
luabind::object(* rwToLuaBindObjectFcn)(const DtReaderWriter *rw, lua_State *L)
Definition: luaScriptInterfaceImpl.h:752
virtual void invokeDisable()=0
Only called for reactive tasks which can be enabled but not active. When the task is completely disab...
std::vector< DtBoost::shared_ptr< const makVrfEvents::DtInfluenceEvent > > myInfluenceEvents
Definition: luaScriptInterfaceImpl.h:738
virtual void invokeTick()=0
This will be called by the parent to invoke the script tick.
std::list< DtVectorOffset3D > luaGetFormationPositions(lua_State *L, const DtScriptVrfObject &unit, const std::string &formationName, int *leaderIndex)
Calls luaGetOptionFormationPositions with empty options.
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
bool luaSetStatePropertyListItem(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, luabind::object const &itemValue)
Sets a single item in a list state property to the given value. First looks in the list to see if any...
const char ContactAliveOnly[]
Definition: luaScriptInterfaceImpl.h:42
boost::shared_ptr< DtScriptFunctionReference > DtScriptFunctionReferencePtr
Shared ptr to DtScriptFunctionReference.
Definition: scriptInterface.h:53
luabind::object luaGetStatePropertyListItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
Returns an object containing the value of the of an item in the given state property. The state property must be a list. The item returned will have values matching the specified key values in the key fields. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty. Sets index to be the index of the item, using the Lua convention that the first item is at index 1.
This stream is used by the scripting classes to be able to send out translatable messages from script...
Definition: translatableStream.h:22
luabind::object luaGetContactInfo(lua_State *L, const DtScriptOwnshipObject &thisEntity, const DtScriptVrfObject &otherEntity)
Gets the perceived contact info that this entity has for another entity.
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
Override of DtScriptInterface::DtScriptFunctionReference that holds a function reference by function ...
Definition: luaScriptInterfaceImpl.h:621
std::vector< DtLuaScriptInterfaceExtension * > LocalInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:713
Abstract object used to hold a reference to a function defined in the script language, to be used later to invoke that function. Used for registering callbacks to be invoked after specified types of set data requests are executed. For this functionality to be used in a derived script interface implementation, a derived class must be implemented to represent a reference to a function in the script language.
Definition: scriptInterface.h:42
luabind::object luaGetEntityParam(lua_State *L, const DtScriptVrfObject &entity, std::string const &paramName)
luabind::object luaGetStateProperty(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName)
Returns an object containing the value of the requested state property. May be a table containing a n...
virtual void processClearForReuse()
This function should be overridden by the inheritor to clear out any task specific variables...
Definition: asyncJobServer.h:39
bool luaSetSubordinateFunction(lua_State *L, const DtScriptVrfObject &entity, const DtScriptVrfObject &subEntity, const std::string &subFunction)
Given a table of {{&quot;subordinate&quot; = DtScriptVrfObject, &quot;function&quot; = string}} Set the state propert...
Contains the DtTranslatableStream class declaration.
const char ContactCurrentlyDetectedOnly[]
Definition: luaScriptInterfaceImpl.h:44
DtLuaScriptInterfaceExtension *(* CreatorFcn)(void *usr)
Prototype for DtLuaScriptInterfaceExtension creator function.
Definition: luaScriptInterfaceExtension.h:37
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
luabind::object luaGetOwnshipParameterPropertyMapItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue)
DtScriptInterface & operator=(const DtScriptInterface &other)
virtual bool invokeCheck()=0
The DtLuaFeatureSet class is a wrapper around a DtFeatureSet that will provide feature information fo...
Definition: luaFeatureSet.h:28
LuaExtension()
Definition: luaScriptInterfaceImpl.h:718
std::map< DtString, ReaderWriterToLuaTableFcn > ReaderWriterToLuaTableMap
Definition: luaScriptInterfaceImpl.h:733
DtLuaScriptInterfaceExtension.
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
bool luaSetSystemAttribute(DtScriptComponentSystem &system, const std::string &attributeName, const luabind::object &value, lua_State *L)
Contains Extended DI-Guy Object net types.
luabind::object luaGetTargetPriorityList(lua_State *L, const DtScriptOwnshipObject &thisEntity)
Gets the target priority list that this entity has.
void * usr
Definition: luaScriptInterfaceImpl.h:724
const char ContactHostileOnly[]
Definition: luaScriptInterfaceImpl.h:43
Definition: luaScriptInterfaceImpl.h:716
The &quot;this&quot; version is the own-ship object. It is separated to allow special functions for the ownshi...
Definition: scriptVrfObject.h:385
DtLuaMessageInterface * myMessageInterface
Definition: luaScriptInterfaceImpl.h:735
std::list< DtVectorOffset3D > luaGetOptionFormationPositions(lua_State *L, const DtScriptVrfObject &unit, const std::string &formationName, luabind::object const &options, int *leaderIndex)
Gets a list of offset vectors defining the positions in the formation. Returns the index of the leade...
This class is a wrapper for a DtCompSystem for use by scripts. It derives from DtAsciiSerializable so...
Definition: scriptComponentSystem.h:18
This class is a two-way interface between the script language and its parent controller. There are functions that either the parent controller will call on the script interface (such as tick() ) and there will be functions the script interface will call on the parent controller to inform the parent of status updates and for data access.
Definition: scriptInterface.h:31
std::string myFunctionName
Definition: luaScriptInterfaceImpl.h:657
luabind::object luaGetOwnshipParameterPropertyListItemByIndex(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, int index)
virtual void invokeSuspend()=0
voidpf uLong offset
Definition: ioapi.h:42
A DtSetDataRequestMessage is a DtRadioMsg with a pointer to a setDataRequest. The type of the DtSetDa...
Definition: setDataRequestMessage.h:29
luabind::object luaGetStateOwnshipProperty(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName)
bool luaSetOrAddStateProperty(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &prop, bool addIfNotFound)
Sets the specified state property with the given value. If not found and addIfNotFound is true...
std::list< DtScriptVrfObject > luaGetContacts(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, luabind::object const &flags)
Lua &quot;getContacts()&quot; Return a list of contacts matching the given table of entity type filters...
luabind::object luaGetParameterPropertyMapItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValue)
Returns an object containing the value of the of an item in the given parameter property. The property must be a map. The item returned will have values matching the specified key value. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or map item could not be found, the returned table will be empty.
std::list< DtScriptVrfObject > luaGetHostileContactsWithFilterAliveOnly(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly, bool aliveOnly)
This function is the same as luaGetContactsWithFilterAliveOnly, but it returns only hostile contacts...
virtual void invokeShutdown()=0
virtual void invokeUpdateDisplayGraph()=0
Called when graphs are enabled to get an immediate graph output.
virtual ~DtLuaScriptFunctionReference()
Definition: luaScriptInterfaceImpl.h:631
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
Definition: scriptVrfObject.h:29
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)