VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 
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
DtMunitionResource * next(bool move=true, bool recurse=false)
moves the index to the next munition resource found in the list and returns the object at that positi...
Definition: munitionResourceIterator.h:73
DtSimResource * next(bool move=true, bool recurse=false)
moves the index to the next position and returns the object at that position in the list...
Definition: recursiveResourceIterator.h:95
virtual DtString type() const =0
The data type of the resource. These types are defined in rsrcTypes.h.
const DtRecursiveResourceIterator & operator=(const DtRecursiveResourceIterator &orig)
Assignment Operator.
DtSimResource * current() const
returns the current object. List index is unmodified.
Definition: recursiveResourceIterator.h:63
DtMunitionResourceIterator(const DtList &list)
Constructor.
Definition: munitionResourceIterator.h:50
const char DtMunitionResourceType[]
Definition: rsrcTypes.h:23
File: recRsrcIter.h.
Definition: recursiveResourceIterator.h:32
File: munitRsrcIter.h.
Definition: munitionResourceIterator.h:33
virtual ~DtMunitionResourceIterator()
Destructor.
Definition: munitionResourceIterator.h:54
DtSimResource is an abstract base class that can be used to create a hierarchical resource list of a ...
Definition: simResource.h:41
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
DtMunitionResource * firstMatch(DtSimResource *initial, bool move=true, bool recurse=false)
Returns the first item matching the filter test, starting with the given initial item.
Definition: munitionResourceIterator.h:80
DtSimResource * first(bool move=true)
Calls reset() if reset arg is true (useful for for() loops).
Definition: recursiveResourceIterator.h:57
DtMunitionResource * first()
Calls reset() if reset arg is true (useful for for() loops).
Definition: munitionResourceIterator.h:58
DtMunitionResource * current() const
returns the current object. List index is unmodified.
Definition: munitionResourceIterator.h:64
Contains the DtMunitionResource class declaration.
Definition: munitionResource.h:24

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)