VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
23 #include "vrfutil/rsrcTypes.h"
25 
26 
32 #include "vrfutil/vrfutilDefines.h"
34 {
35 private:
38 
41  const DtMunitionResourceIterator& orig);
42 
45  const DtMunitionResourceIterator& orig);
46 
47 public:
48 
50  DtMunitionResourceIterator(const DtList& list) :
52 
55 
59  {
60  return firstMatch(DtRecursiveResourceIterator::first(), true,DtTrue);
61  }
62 
65  {
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  {
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 Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)