Call the correct system rename
[Torque-3d.git] / Engine / source / T3D / aiClient.h
blobbe185db45c109000eac96cc358affcec385389cc
1 //-----------------------------------------------------------------------------
2 // Copyright (c) 2012 GarageGames, LLC
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to
6 // deal in the Software without restriction, including without limitation the
7 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 // sell copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 // IN THE SOFTWARE.
21 //-----------------------------------------------------------------------------
23 #ifndef _AICLIENT_H_
24 #define _AICLIENT_H_
26 #ifndef _AICONNECTION_H_
27 #include "T3D/aiConnection.h"
28 #endif
29 #ifndef _TVECTOR_H_
30 #include "core/util/tVector.h"
31 #endif
33 class ShapeBase;
34 class Player;
36 class AIClient : public AIConnection {
38 typedef AIConnection Parent;
40 private:
41 enum {
42 FireTrigger = 0,
43 JumpTrigger = 2,
44 JetTrigger = 3,
45 GrenadeTrigger = 4,
46 MineTrigger = 5
49 F32 mMoveSpeed;
50 S32 mMoveMode;
51 F32 mMoveTolerance; // How close to the destination before we stop
53 bool mTriggers[MaxTriggerKeys];
55 Player *mPlayer;
57 Point3F mMoveDestination;
58 Point3F mLocation;
59 Point3F mLastLocation; // For stuck check
61 bool mAimToDestination;
62 Point3F mAimLocation;
63 bool mTargetInLOS;
65 SimObjectPtr<ShapeBase> mTargetObject;
67 // Utility Methods
68 void throwCallback( const char *name );
69 public:
71 DECLARE_CONOBJECT( AIClient );
73 DECLARE_CALLBACK( void, onConnect, (const char* idString) );
75 enum {
76 ModeStop = 0,
77 ModeMove,
78 ModeStuck,
79 ModeCount // This is in there as a max index value
82 AIClient();
83 ~AIClient();
85 U32 getMoveList( Move **movePtr,U32 *numMoves );
87 // ---Targeting and aiming sets/gets
88 void setTargetObject( ShapeBase *targetObject );
89 S32 getTargetObject() const;
91 // ---Movement sets/gets
92 void setMoveSpeed( const F32 speed );
93 F32 getMoveSpeed() const { return mMoveSpeed; }
95 void setMoveMode( S32 mode );
96 S32 getMoveMode() const { return mMoveMode; }
98 void setMoveTolerance( const F32 tolerance );
99 F32 getMoveTolerance() const { return mMoveTolerance; }
101 void setMoveDestination( const Point3F &location );
102 Point3F getMoveDestination() const { return mMoveDestination; }
104 Point3F getLocation() const { return mLocation; }
106 // ---Facing(Aiming) sets/gets
107 void setAimLocation( const Point3F &location );
108 Point3F getAimLocation() const { return mAimLocation; }
109 void clearAim();
111 // ---Other
112 void missionCycleCleanup();
113 void onAdd( const char *nameSpace );
116 #endif