Gadget
otherfoodptrvector.h
Go to the documentation of this file.
1 #ifndef otherfoodptrvector_h
2 #define otherfoodptrvector_h
3 
4 #include "otherfood.h"
5 
6 class OtherFood;
7 
13 public:
17  OtherFoodPtrVector() { size = 0; v = 0; };
22  OtherFoodPtrVector(const OtherFoodPtrVector& initial);
32  void resize(OtherFood* value);
38  void Delete(int pos);
43  int Size() const { return size; };
49  OtherFood*& operator [] (int pos) { return v[pos]; };
55  OtherFood* const& operator [] (int pos) const { return v[pos]; };
56 protected:
64  int size;
65 };
66 
67 #endif
This class implements a dynamic vector of OtherFood values.
Definition: otherfoodptrvector.h:12
OtherFoodPtrVector()
This is the default OtherFoodPtrVector constructor.
Definition: otherfoodptrvector.h:17
void Delete(int pos)
This will delete an entry from the vector.
Definition: otherfoodptrvector.cc:37
int Size() const
This will return the size of the vector.
Definition: otherfoodptrvector.h:43
~OtherFoodPtrVector()
This is the OtherFoodPtrVector destructor.
Definition: otherfoodptrvector.cc:15
void resize(OtherFood *value)
This will add one new entry to the vector.
Definition: otherfoodptrvector.cc:22
OtherFood *& operator[](int pos)
This will return the value of an element of the vector.
Definition: otherfoodptrvector.h:49
int size
This is the size of the vector.
Definition: otherfoodptrvector.h:64
OtherFood ** v
This is the vector of OtherFood values.
Definition: otherfoodptrvector.h:55
This is the class used to model the available prey that is not modelled dynamically.
Definition: otherfood.h:16