646 lines
18 KiB
C++
646 lines
18 KiB
C++
// Implementation for the definition of the class representing a mini-structure
|
|
// (Base class) (actors datas)
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
#include "StdAfx.h"
|
|
|
|
#include "_AInterf.hpp"
|
|
|
|
#include "EDACMStA.hpp"
|
|
|
|
#include "EDACModl.hpp"
|
|
#include "EDACVwMS.hpp"
|
|
#include "EDACVwAc.hpp"
|
|
#include "EDACStrg.hpp"
|
|
#include "ErO.h"
|
|
|
|
#undef CPA_WANTS_IMPORT
|
|
#undef CPA_EXPORT
|
|
#define CPA_WANTS_EXPORT
|
|
#include "_Actors.hpp"
|
|
#undef CPA_WANTS_EXPORT
|
|
#define CPA_WANTS_IMPORT
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
//***************************************************************************
|
|
EdActors_ActorMiniStructure::EdActors_ActorMiniStructure(CString csScriptName)
|
|
{
|
|
m_csScriptName = csScriptName;
|
|
|
|
m_tdeState = MS_STATE_UNALLOCATED;
|
|
m_bDataCreated = FALSE;
|
|
m_bDataInitialized = FALSE;
|
|
m_pclParentActor = NULL;
|
|
m_pclParentMS = NULL;
|
|
|
|
m_td_pfn_vFillFunction = NULL;
|
|
m_td_pfn_vAllocationFunction = NULL;
|
|
m_td_pfn_vUnallocationFunction = NULL;
|
|
m_td_pfn_vInstanciationSpecialFunction = NULL;
|
|
m_td_pfn_vBeforeAllocationSpecialFunction = NULL;
|
|
m_td_pfn_vAfterAllocationSpecialFunction = NULL;
|
|
|
|
m_pvBaseAddress = NULL;
|
|
m_pvKeptAddress = NULL;
|
|
m_bIsReallyAllocated = FALSE;
|
|
|
|
m_pclDataList = new CTL_Editor_DataList;
|
|
|
|
m_pri_tdstWatchField.eType = OAC_WATCH_FIELD_TYPE__NONE;
|
|
m_pri_tdstWatchField.p_vData = (void *)this;
|
|
m_pri_tdstWatchField.pclWatchData = NULL;
|
|
}
|
|
|
|
//***************************************************************************
|
|
EdActors_ActorMiniStructure::~EdActors_ActorMiniStructure()
|
|
{
|
|
delete m_pclDataList;
|
|
}
|
|
|
|
//***************************************************************************
|
|
BOOL EdActors_ActorMiniStructure::m_fn_bAllocate(BOOL bCanBeUndone /*= FALSE*/)
|
|
{
|
|
BOOL bReturn = FALSE;
|
|
|
|
if ( !m_fn_bIsAllocated() )
|
|
{
|
|
if ( bCanBeUndone )
|
|
{
|
|
//Allocation for an Instance can never be Undone
|
|
// ERROR_ASSERT( m_pclParentActor->m_pclActor->m_fn_bIsAModel() );
|
|
|
|
EdActors_ActorMSAllocateModif *pclModif = new EdActors_ActorMSAllocateModif(this);
|
|
bReturn = m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
|
|
|
//Updates Undo / Redo Buttons
|
|
g_pclInterface->m_clDocument.m_pclActorsView->m_fn_vUpdateUndoRedoButtons();
|
|
}
|
|
else
|
|
{
|
|
if ( !m_bIsReallyAllocated )
|
|
bReturn = m_fn_bRealAllocate();
|
|
else
|
|
{
|
|
m_fn_vUnrealAllocate();
|
|
bReturn = TRUE;
|
|
}
|
|
}
|
|
|
|
m_bIsReallyAllocated = bReturn;
|
|
}
|
|
|
|
return bReturn;
|
|
}
|
|
|
|
//***************************************************************************
|
|
BOOL EdActors_ActorMiniStructure::m_fn_bUnallocate(BOOL bCanBeUndone /*= FALSE*/)
|
|
{
|
|
BOOL bReturn;
|
|
|
|
if ( M_GetMainApp()->m_bLeavingApplication == FALSE )
|
|
{
|
|
//For an Instance
|
|
if ( m_pclParentActor->m_fn_bIsAnInstance() )
|
|
{
|
|
//Removes fields from Watch Window if necessary
|
|
POSITION pos = m_pclDataList->GetHeadPosition();
|
|
CTL_Editor_Data *pclData;
|
|
while ( pos != NULL )
|
|
{
|
|
pclData = m_pclDataList->GetNext(pos);
|
|
|
|
if ( OAC_fn_bDataIsInWatch(pclData) )
|
|
OAC_RemoveFieldFromWatchWindow(pclData);
|
|
}
|
|
|
|
//Removes concerned modif from Undo Manager
|
|
CPA_Modif *pclModif;
|
|
pos = m_pclParentActor->m_clUndoManager.ListOfModifs.GetHeadPosition();
|
|
while ( pos != NULL )
|
|
{
|
|
pclModif = m_pclParentActor->m_clUndoManager.ListOfModifs.GetNext(pos);
|
|
|
|
//PROVISOIRE...
|
|
//Removes all undo from instances lists
|
|
delete pclModif;
|
|
}
|
|
m_pclParentActor->m_clUndoManager.ListOfModifs.RemoveAll();
|
|
|
|
//(Unreal) unallocates MS
|
|
m_fn_vUnrealUnallocate();
|
|
}
|
|
//For a Model
|
|
else
|
|
{
|
|
EdActors_ActorMSUnallocateModif *pclModif = new EdActors_ActorMSUnallocateModif(this);
|
|
bReturn = m_pclParentActor->m_clUndoManager.AskFor(pclModif);
|
|
}
|
|
}
|
|
|
|
return bReturn;
|
|
}
|
|
|
|
//***************************************************************************
|
|
BOOL EdActors_ActorMiniStructure::m_fn_bRealAllocate()
|
|
{
|
|
ERROR_ASSERT( m_td_pfn_vFillFunction != NULL );
|
|
ERROR_ASSERT( m_td_pfn_vAllocationFunction != NULL );
|
|
|
|
//Calls "before" special fucntion
|
|
if ( m_td_pfn_vBeforeAllocationSpecialFunction != NULL )
|
|
m_td_pfn_vBeforeAllocationSpecialFunction(this);
|
|
|
|
//First constructs the Data List (no effect if already done once)
|
|
m_td_pfn_vFillFunction(m_pclParentActor, this);
|
|
|
|
//Calls the motor's allocation function
|
|
ERROR_ASSERT( m_pclParentActor->m_fn_ptdstGetMotorActor() != NULL );
|
|
m_td_pfn_vAllocationFunction(m_pclParentActor->m_fn_ptdstGetMotorActor());
|
|
|
|
//Fills the MS with new datas pointers
|
|
m_td_pfn_vFillFunction(m_pclParentActor, this);
|
|
|
|
//Sets the new state for the MS
|
|
m_tdeState = MS_STATE_DEVELOPPED;
|
|
|
|
//Calls "after" special fucntion
|
|
if ( m_td_pfn_vAfterAllocationSpecialFunction != NULL )
|
|
m_td_pfn_vAfterAllocationSpecialFunction(this);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
//For Undo / Redo
|
|
//***************************************************************************
|
|
void EdActors_ActorMiniStructure::m_fn_vUnrealAllocate()
|
|
{
|
|
ERROR_PREPARE_M(g_c_csActorModuleNameForErrors,
|
|
"Trying to allocate a MS, which has been unallocated",
|
|
"EdActors_ActorMiniStructure::m_fn_vUnrealAllocate()",
|
|
E_ERROR_GRAVITY_INSTABLE,
|
|
"This probably means that a MS was allocated in an Instance, but not in its Model (when they were loaded)");
|
|
ERROR_ASSERT( m_pvKeptAddress != NULL );
|
|
|
|
if ( m_pvKeptAddress != NULL )
|
|
{
|
|
//m_fn_vSetBaseAddress(m_pvKeptAddress);
|
|
memcpy(m_pvBaseAddress, &m_pvKeptAddress, sizeof(void *));
|
|
|
|
//Sets the new state for the MS
|
|
m_tdeState = MS_STATE_DEVELOPPED;
|
|
|
|
//Updates display
|
|
g_pclInterface->m_clDocument.m_pclMiniStrucView->m_fn_vUpdateTree();
|
|
}
|
|
}
|
|
|
|
//***************************************************************************
|
|
void EdActors_ActorMiniStructure::m_fn_vUnrealUnallocate()
|
|
{
|
|
//Pointer on real MS is kept here...
|
|
m_pvKeptAddress = m_fn_pvGetBaseAddress();
|
|
|
|
//...but Pointer in Motor structure is set to NULL
|
|
//m_fn_vSetBaseAddress(NULL);
|
|
long lNULL = 0L;
|
|
memcpy(m_pvBaseAddress, &lNULL, sizeof(long));
|
|
|
|
//Sets the new state for the MS
|
|
m_tdeState = MS_STATE_UNALLOCATED;
|
|
|
|
//Updates display
|
|
g_pclInterface->m_clDocument.m_pclMiniStrucView->m_fn_vUpdateTree();
|
|
}
|
|
|
|
//***************************************************************************
|
|
BOOL EdActors_ActorMiniStructure::m_fn_bCallSpecialFunction()
|
|
{
|
|
if ( m_td_pfn_vInstanciationSpecialFunction != NULL )
|
|
{
|
|
if ( m_fn_bIsAllocated() )
|
|
m_td_pfn_vInstanciationSpecialFunction(this);
|
|
|
|
return TRUE;
|
|
}
|
|
else
|
|
return FALSE;
|
|
}
|
|
|
|
//***************************************************************************
|
|
BOOL EdActors_ActorMiniStructure::m_fn_bIsAllocated()
|
|
{
|
|
return ( m_tdeState != MS_STATE_UNALLOCATED );
|
|
}
|
|
|
|
//***************************************************************************
|
|
BOOL EdActors_ActorMiniStructure::m_fn_bCanBeUnallocated()
|
|
{
|
|
if ( m_pclParentMS != NULL )
|
|
return ( m_pclParentMS->m_fn_bCanBeUnallocated() );
|
|
else
|
|
return TRUE;
|
|
}
|
|
|
|
//***************************************************************************
|
|
BOOL EdActors_ActorMiniStructure::m_fn_bIsOpen()
|
|
{
|
|
return ( m_tdeState == MS_STATE_DEVELOPPED );
|
|
}
|
|
|
|
//***************************************************************************
|
|
CString EdActors_ActorMiniStructure::m_fn_csGetScriptName()
|
|
{
|
|
return m_csScriptName;
|
|
}
|
|
|
|
//***************************************************************************
|
|
void EdActors_ActorMiniStructure::m_fn_vSetScriptName(CString csNewName)
|
|
{
|
|
m_csScriptName = csNewName;
|
|
}
|
|
|
|
//***************************************************************************
|
|
void *EdActors_ActorMiniStructure::m_fn_pvGetBaseAddress()
|
|
{
|
|
long *p_lPointerToAddressOfMS = (long *)m_pvBaseAddress;
|
|
return (void *)(*p_lPointerToAddressOfMS);
|
|
}
|
|
|
|
//***************************************************************************
|
|
void EdActors_ActorMiniStructure::m_fn_vSetBaseAddress(void *pvNewAddress)
|
|
{
|
|
m_pvBaseAddress = pvNewAddress;
|
|
}
|
|
|
|
//***************************************************************************
|
|
//To init all data in the AMS
|
|
void EdActors_ActorMiniStructure::m_pub_fn_vInitializeAllData()
|
|
{
|
|
if ( !m_bDataInitialized )
|
|
{
|
|
POSITION pos = m_pclDataList->GetHeadPosition();
|
|
while ( pos != NULL )
|
|
m_pclDataList->GetNext(pos)->m_fn_vInitData();
|
|
|
|
m_bDataInitialized = TRUE;
|
|
}
|
|
}
|
|
|
|
//***************************************************************************
|
|
//To get all motor Data
|
|
void EdActors_ActorMiniStructure::m_pub_fn_vGetAllMotorData()
|
|
{
|
|
POSITION pos = m_pclDataList->GetHeadPosition();
|
|
while ( pos != NULL )
|
|
m_pclDataList->GetNext(pos)->m_fn_vGetMotorData();
|
|
}
|
|
|
|
//***************************************************************************
|
|
OAC_tdstWatchField *EdActors_ActorMiniStructure::m_pub_fn_p_tdstGetWatchField()
|
|
{
|
|
return (&m_pri_tdstWatchField);
|
|
}
|
|
|
|
|
|
//**************************************************************************************
|
|
//**************************************************************************************
|
|
//**************************************************************************************
|
|
//Modif class
|
|
//************************************************************************
|
|
//Constructor
|
|
EdActors_ActorMSAllocateModif::EdActors_ActorMSAllocateModif(EdActors_ActorMiniStructure *pclAMS)
|
|
: CPA_Modif(0, "MS allocated")
|
|
{
|
|
m_pclAMS = pclAMS;
|
|
|
|
CString csName = CString("MS '") + m_pclAMS->m_fn_csGetScriptName() + "' allocated";
|
|
SetName(csName);
|
|
}
|
|
|
|
//************************************************************************
|
|
//Destructor
|
|
EdActors_ActorMSAllocateModif::~EdActors_ActorMSAllocateModif()
|
|
{
|
|
|
|
}
|
|
|
|
//************************************************************************
|
|
BOOL EdActors_ActorMSAllocateModif::Do()
|
|
{
|
|
EdActors_EditorActorModel *pclEdModel = NULL;
|
|
|
|
//Only for Models !
|
|
if (m_pclAMS->m_pclParentActor->m_pclActor->m_fn_bIsAModel())
|
|
pclEdModel = (EdActors_EditorActorModel *)m_pclAMS->m_pclParentActor;
|
|
|
|
if ( !m_pclAMS->m_bIsReallyAllocated )
|
|
{
|
|
m_pclAMS->m_fn_bRealAllocate();
|
|
|
|
//(Real) Allocation for Instances MS
|
|
if (pclEdModel)
|
|
pclEdModel->m_fn_vAllocateMSInInstances(m_pclAMS);
|
|
}
|
|
else
|
|
//This is a Redo
|
|
{
|
|
m_pclAMS->m_fn_vUnrealAllocate();
|
|
|
|
//Unreal allocation for Instances
|
|
if (pclEdModel)
|
|
pclEdModel->m_fn_vAllocateMSInInstances(m_pclAMS);
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
//************************************************************************
|
|
BOOL EdActors_ActorMSAllocateModif::Undo()
|
|
{
|
|
EdActors_EditorActorModel *pclEdModel = NULL;
|
|
|
|
//Only for Models !
|
|
if (m_pclAMS->m_pclParentActor->m_pclActor->m_fn_bIsAModel())
|
|
pclEdModel = (EdActors_EditorActorModel *)m_pclAMS->m_pclParentActor;
|
|
|
|
ERROR_ASSERT( m_pclAMS->m_bIsReallyAllocated );
|
|
|
|
m_pclAMS->m_fn_vUnrealUnallocate();
|
|
|
|
//Unreal unallocation for Instances
|
|
if (pclEdModel)
|
|
pclEdModel->m_fn_vUnallocateMSInInstances(m_pclAMS);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
//**************************************************************************************
|
|
//**************************************************************************************
|
|
//Modif class
|
|
//************************************************************************
|
|
//Constructor
|
|
EdActors_ActorMSUnallocateModif::EdActors_ActorMSUnallocateModif(EdActors_ActorMiniStructure *pclAMS)
|
|
: CPA_Modif(0)
|
|
{
|
|
m_pclAMS = pclAMS;
|
|
|
|
CString csName = CString("MS '") + m_pclAMS->m_fn_csGetScriptName() + "' unallocated";
|
|
SetName(csName);
|
|
}
|
|
|
|
//************************************************************************
|
|
//Destructor
|
|
EdActors_ActorMSUnallocateModif::~EdActors_ActorMSUnallocateModif()
|
|
{
|
|
|
|
}
|
|
|
|
//************************************************************************
|
|
BOOL EdActors_ActorMSUnallocateModif::Do()
|
|
{
|
|
//Only for Models !
|
|
ERROR_ASSERT( !m_pclAMS->m_pclParentActor->m_fn_bIsAnInstance() );
|
|
EdActors_EditorActorModel *pclEdModel = (EdActors_EditorActorModel *)m_pclAMS->m_pclParentActor;
|
|
|
|
ERROR_ASSERT( m_pclAMS->m_bIsReallyAllocated );
|
|
|
|
m_pclAMS->m_fn_vUnrealUnallocate();
|
|
|
|
//Unreal allocation for Instances
|
|
pclEdModel->m_fn_vUnallocateMSInInstances(m_pclAMS);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
//************************************************************************
|
|
BOOL EdActors_ActorMSUnallocateModif::Undo()
|
|
{
|
|
//Only for Models !
|
|
ERROR_ASSERT( !m_pclAMS->m_pclParentActor->m_fn_bIsAnInstance() );
|
|
EdActors_EditorActorModel *pclEdModel = (EdActors_EditorActorModel *)m_pclAMS->m_pclParentActor;
|
|
|
|
ERROR_ASSERT( m_pclAMS->m_bIsReallyAllocated );
|
|
|
|
m_pclAMS->m_fn_vUnrealAllocate();
|
|
|
|
//Unreal unallocation for Instances
|
|
pclEdModel->m_fn_vAllocateMSInInstances(m_pclAMS);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
//**************************************************************************************
|
|
//**************************************************************************************
|
|
//**************************************************************************************
|
|
|
|
EdActors_ActorMiniStructureList::EdActors_ActorMiniStructureList(CString csScriptName)
|
|
{
|
|
m_csGroupScriptName = csScriptName;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
EdActors_ActorMiniStructureList::~EdActors_ActorMiniStructureList()
|
|
{
|
|
m_fn_vEmptyList();
|
|
}
|
|
|
|
//**************************************************************************************
|
|
EdActors_ActorMiniStructure* EdActors_ActorMiniStructureList::m_fn_pclAddElement(CString csScriptName)
|
|
{
|
|
EdActors_ActorMiniStructure *pclNewElement = new EdActors_ActorMiniStructure(csScriptName);
|
|
|
|
AddTail(pclNewElement);
|
|
|
|
return pclNewElement;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
void EdActors_ActorMiniStructureList::m_fn_vEmptyList()
|
|
{
|
|
POSITION pos = GetHeadPosition();
|
|
while( pos != NULL )
|
|
delete (GetNext(pos));
|
|
|
|
RemoveAll();
|
|
}
|
|
|
|
//**************************************************************************************
|
|
CString EdActors_ActorMiniStructureList::m_fn_csGetGroupScriptName()
|
|
{
|
|
return m_csGroupScriptName;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
EdActors_ActorMiniStructure *EdActors_ActorMiniStructureList::m_fn_pclGetAMSFromName(CString csNameOfAMSToSearch)
|
|
{
|
|
EdActors_ActorMiniStructure *pclFoundAMS = NULL;
|
|
EdActors_ActorMiniStructure *pclCurrentAMS;
|
|
|
|
POSITION pos = GetHeadPosition();
|
|
while( (pos != NULL) && (pclFoundAMS == NULL) )
|
|
{
|
|
pclCurrentAMS = GetNext(pos);
|
|
|
|
if ( pclCurrentAMS->m_fn_csGetScriptName().Compare(csNameOfAMSToSearch) == 0 )
|
|
pclFoundAMS = pclCurrentAMS;
|
|
}
|
|
|
|
return pclFoundAMS;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
void EdActors_ActorMiniStructureList::m_pub_fn_vGetAllMotorData()
|
|
{
|
|
POSITION pos = GetHeadPosition();
|
|
while( pos != NULL )
|
|
GetNext(pos)->m_pub_fn_vGetAllMotorData();
|
|
}
|
|
|
|
//**************************************************************************************
|
|
//**************************************************************************************
|
|
//**************************************************************************************
|
|
// Definition of the class for the list of mini-structures lists (!!!)
|
|
|
|
//**************************************************************************************
|
|
EdActors_AMSListList::EdActors_AMSListList()
|
|
{
|
|
|
|
}
|
|
|
|
//**************************************************************************************
|
|
EdActors_AMSListList::~EdActors_AMSListList()
|
|
{
|
|
|
|
}
|
|
|
|
//**************************************************************************************
|
|
EdActors_ActorMiniStructureList *EdActors_AMSListList::m_fn_pclAddList(CString csScriptName)
|
|
{
|
|
EdActors_ActorMiniStructureList *pclCreatedList;
|
|
|
|
pclCreatedList = new EdActors_ActorMiniStructureList(csScriptName);
|
|
|
|
AddTail(pclCreatedList);
|
|
|
|
return pclCreatedList;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
//Returns NULL if Index is not in a right range
|
|
EdActors_ActorMiniStructureList *EdActors_AMSListList::m_fn_pclGetListFromIndex(unsigned char ucIndex)
|
|
{
|
|
unsigned char ucCurrentIndex = 0;
|
|
EdActors_ActorMiniStructureList *pclAMSList = NULL;
|
|
|
|
POSITION pos = GetHeadPosition();
|
|
while ( (pos != NULL) && (ucCurrentIndex != (ucIndex+1)) )
|
|
{
|
|
if ( ucCurrentIndex == ucIndex )
|
|
pclAMSList = GetNext(pos);
|
|
else
|
|
GetNext(pos);
|
|
|
|
ucCurrentIndex ++;
|
|
}
|
|
|
|
return pclAMSList;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
//Returns (-1) if Index is AMS List is not found
|
|
char EdActors_AMSListList::m_fn_cGetIndexFromList(EdActors_ActorMiniStructureList *pclAMSList)
|
|
{
|
|
char cIndex = 0;
|
|
BOOL bFound = FALSE;
|
|
|
|
POSITION pos = GetHeadPosition();
|
|
while ( (pos != NULL) && (!bFound) )
|
|
{
|
|
bFound = (pclAMSList == GetNext(pos));
|
|
|
|
if ( !bFound )
|
|
cIndex ++;
|
|
}
|
|
|
|
if ( bFound )
|
|
return cIndex;
|
|
else
|
|
return (-1);
|
|
}
|
|
|
|
//**************************************************************************************
|
|
//Returns (-1) if Index is AMS is not found
|
|
char EdActors_AMSListList::m_fn_cGetIndexFromAMS(EdActors_ActorMiniStructure *pclAMS)
|
|
{
|
|
char cIndex = 0;
|
|
BOOL bFound = FALSE;
|
|
EdActors_ActorMiniStructureList *pclAMSList;
|
|
|
|
POSITION pos = GetHeadPosition();
|
|
POSITION AMSPos;
|
|
while ( (pos != NULL) && (!bFound) )
|
|
{
|
|
pclAMSList = GetNext(pos);
|
|
|
|
AMSPos = pclAMSList->GetHeadPosition();
|
|
while ( (AMSPos != NULL) && (!bFound) )
|
|
bFound = (pclAMS == pclAMSList->GetNext(AMSPos));
|
|
|
|
if ( !bFound )
|
|
cIndex ++;
|
|
}
|
|
|
|
if ( bFound )
|
|
return cIndex;
|
|
else
|
|
return (-1);
|
|
}
|
|
|
|
//**************************************************************************************
|
|
EdActors_ActorMiniStructure *EdActors_AMSListList::m_fn_pclGetAMSFromName(CString csNameOfAMSToSearch)
|
|
{
|
|
EdActors_ActorMiniStructure *pclFoundAMS = NULL;
|
|
EdActors_ActorMiniStructureList *pclAMSList;
|
|
|
|
POSITION pos = GetHeadPosition();
|
|
while ( (pos != NULL) && (pclFoundAMS == NULL) )
|
|
{
|
|
pclAMSList = GetNext(pos);
|
|
|
|
pclFoundAMS = pclAMSList->m_fn_pclGetAMSFromName(csNameOfAMSToSearch);
|
|
}
|
|
|
|
return pclFoundAMS;
|
|
}
|
|
|
|
//**************************************************************************************
|
|
// Returns the first data found in the list, with the given name
|
|
CTL_Editor_Data *EdActors_AMSListList::m_fn_pclGetDataFromName(CString _csName)
|
|
{
|
|
CTL_Editor_Data *pclFoundData = NULL;
|
|
EdActors_ActorMiniStructureList *pclCurrentAMSList;
|
|
EdActors_ActorMiniStructure *pclCurrentAMS;
|
|
|
|
POSITION AMSListPos = GetHeadPosition();
|
|
while ( (AMSListPos != NULL) && (pclFoundData == NULL) )
|
|
{
|
|
pclCurrentAMSList = GetNext(AMSListPos);
|
|
|
|
POSITION AMSPos = pclCurrentAMSList->GetHeadPosition();
|
|
while ( (AMSPos != NULL) && (pclFoundData == NULL) )
|
|
{
|
|
pclCurrentAMS = pclCurrentAMSList->GetNext(AMSPos);
|
|
|
|
pclFoundData = pclCurrentAMS->m_pclDataList->m_fn_pclGetDataFromName(_csName);
|
|
}
|
|
}
|
|
|
|
return pclFoundData;
|
|
}
|