VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrfutil
munitionResourceIterator.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2004 MaK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: munitRsrcIter.h,v $ $Revision: 1.3 $ $State: Exp $
7
Created: 5/13/04 MEM
8
*******************************************************************************/
9
12
18
19
#ifndef DtMunitionResourceIterator_H_
20
#define DtMunitionResourceIterator_H_
21
22
#include "
vrfutil/munitionResource.h
"
23
#include "
vrfutil/rsrcTypes.h
"
24
#include "
vrfutil/recursiveResourceIterator.h
"
25
26
32
#include "
vrfutil/vrfutilDefines.h
"
33
class
DT_DLL_vrfutil
DtMunitionResourceIterator
:
public
DtRecursiveResourceIterator
34
{
35
private
:
37
DtMunitionResourceIterator
();
38
40
DtMunitionResourceIterator
(
41
const
DtMunitionResourceIterator
& orig);
42
44
const
DtMunitionResourceIterator
&
operator=
(
45
const
DtMunitionResourceIterator
& orig);
46
47
public
:
48
50
DtMunitionResourceIterator
(
const
DtList& list) :
51
DtRecursiveResourceIterator
(list) {};
52
54
virtual
~DtMunitionResourceIterator
() { };
55
58
DtMunitionResource
*
first
()
59
{
60
return
firstMatch(
DtRecursiveResourceIterator::first
(),
true
,DtTrue);
61
}
62
64
DtMunitionResource
*
current
()
const
65
{
66
return
(
DtMunitionResource
*)
DtRecursiveResourceIterator::current
();
67
}
68
73
DtMunitionResource
*
next
(
bool
move=
true
,
bool
recurse=
false
)
74
{
75
return
firstMatch(
DtRecursiveResourceIterator::next
(move,recurse), move,recurse);
76
}
77
80
DtMunitionResource
* firstMatch(
DtSimResource
* initial,
81
bool
move =
true
,
bool
recurse=
false
)
82
{
83
DtSimResource
* current = initial;
84
DtSimResource
* next = NULL;
85
86
while
(current)
87
{
88
if
(current->
type
()==
DtMunitionResourceType
)
89
{
90
break
;
91
}
92
93
DtSimResource
* next =
DtRecursiveResourceIterator::next
(
false
,recurse);
94
95
if
(next == initial)
//we've checked 'em all, and we haven't found a match
96
{
97
current = NULL;
98
break
;
99
}
100
101
if
(myChildIterator)
102
{
103
current=
DtRecursiveResourceIterator::current
();
104
}
105
else
106
{
107
current =
DtRecursiveResourceIterator::next
(move,recurse);
108
}
109
}
110
111
return
(
DtMunitionResource
*)
current
;
112
113
}
114
115
protected
:
116
117
};
118
119
#endif
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)