Serious-Engine/Sources/EntitiesMP/NavigationMarker.cpp
2016-03-11 15:57:17 +02:00

245 lines
9.5 KiB
C++

/*
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
*/
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
#include "StdH.h"
#include "EntitiesMP/Common/PathFinding.h"
#define MAX_TARGETS 6
#include <EntitiesMP/NavigationMarker.h>
#include <EntitiesMP/NavigationMarker_tables.h>
#line 13 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
// info structure
static EntityInfo eiMarker = {
EIBT_ROCK, 10.0f,
0.0f, 1.0f, 0.0f, // source (eyes)
0.0f, 1.0f, 0.0f, // target (body)
};
void CNavigationMarker::SetDefaultProperties(void) {
m_strName = "Marker";
m_fMarkerRange = 1.0f;
m_penTarget0 = NULL;
m_penTarget1 = NULL;
m_penTarget2 = NULL;
m_penTarget3 = NULL;
m_penTarget4 = NULL;
m_penTarget5 = NULL;
CEntity::SetDefaultProperties();
}
CNavigationMarker::CNavigationMarker(void)
#line 49 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
{
#line 50 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
m_ppnNode = NULL ;
#line 51 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
CNavigationMarker:: ~ CNavigationMarker(void)
#line 53 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
{
#line 54 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
ASSERT (m_ppnNode == NULL );
#line 55 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 58 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
void CNavigationMarker::Read_t(CTStream * istr)
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
{
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CEntity :: Read_t (istr );
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
m_ppnNode = NULL ;
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CEntity * CNavigationMarker::GetTarget(void)const {return m_penTarget0 ;}
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
void * CNavigationMarker::GetEntityInfo(void) {
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return & eiMarker ;
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CPathNode * CNavigationMarker::GetPathNode(void)
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
{
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
if(m_ppnNode == NULL ){
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
m_ppnNode = new CPathNode (this );
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return m_ppnNode ;
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CEntityPointer & CNavigationMarker::TargetPointer(INDEX i)
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
{
#line 83 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
ASSERT (i >= 0 && i < MAX_TARGETS );
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return (& m_penTarget0 ) [ i ];
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CNavigationMarker & CNavigationMarker::Target(INDEX i)
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
{
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return (CNavigationMarker &) * TargetPointer (i );
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CNavigationMarker * CNavigationMarker::GetLink(INDEX i)
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
{
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
for(INDEX iTarget = 0;iTarget < MAX_TARGETS ;iTarget ++){
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CNavigationMarker * penLink = & Target (iTarget );
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
if(penLink == NULL ){
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
continue ;
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 99 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
if(iTarget == i ){
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return penLink ;
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return NULL ;
#line 104 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
const CTString & CNavigationMarker::GetDescription(void)const {
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return m_strName ;
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
BOOL CNavigationMarker::MovesByTargetedRoute(CTString & strTargetProperty)const {
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
strTargetProperty = "Target 0";
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return TRUE ;
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
BOOL CNavigationMarker::DropsMarker(CTFileName & fnmMarkerClass,CTString & strTargetProperty)const {
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
fnmMarkerClass = CTFILENAME ("Classes\\NavigationMarker.ecl");
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
strTargetProperty = "Target 0";
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return TRUE ;
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
BOOL CNavigationMarker::IsMarker(void)const {
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return TRUE ;
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
BOOL CNavigationMarker::
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
Main(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CNavigationMarker_Main
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CNavigationMarker::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
#line 128 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
InitAsEditorModel ();
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
SetPhysicsFlags (EPF_MODEL_IMMATERIAL );
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
SetCollisionFlags (ECF_IMMATERIAL );
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
const FLOAT fSize = 0.25f;
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
GetModelObject () -> StretchModel (FLOAT3D (fSize , fSize , fSize ));
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
SetModel (MODEL_MARKER );
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
ModelChangeNotify ();
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
SetModelMainTexture (TEXTURE_MARKER );
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
for(INDEX iTarget = 0;iTarget < MAX_TARGETS ;iTarget ++){
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CEntityPointer & penTarget = TargetPointer (iTarget );
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
if(penTarget == NULL ){
#line 143 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
continue ;
#line 144 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
if(! IsOfClass (penTarget , "NavigationMarker")){
#line 149 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
penTarget = NULL ;
#line 150 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
continue ;
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 153 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CNavigationMarker & nmOther = (CNavigationMarker &) * penTarget ;
#line 156 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
BOOL bFound = FALSE ;
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
for(INDEX iTarget2 = 0;iTarget2 < MAX_TARGETS ;iTarget2 ++){
#line 158 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CEntityPointer & penTarget2 = nmOther . TargetPointer (iTarget2 );
#line 159 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
if(penTarget2 == this ){
#line 160 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
bFound = TRUE ;
#line 161 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
break ;
#line 162 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 163 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 165 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
if(! bFound ){
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
for(INDEX iTarget2 = 0;iTarget2 < MAX_TARGETS ;iTarget2 ++){
#line 168 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
CEntityPointer & penTarget2 = nmOther . TargetPointer (iTarget2 );
#line 169 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
if(penTarget2 == NULL ){
#line 170 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
penTarget2 = this ;
#line 171 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
break ;
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 173 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 174 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 175 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
}
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
Return(STATE_CURRENT,EVoid());
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/NavigationMarker.es"
return TRUE; ASSERT(FALSE); return TRUE;};