ALMaSS Rodenticide Model ODdox  1.0
IDMap< a_type > Class Template Reference

Used to map locations of animals in space. More...

#include <MovementMap.h>

Public Member Functions

void ClearMapValue (unsigned x, unsigned y)
 
a_type GetMapValue (unsigned x, unsigned y)
 
 IDMap (Landscape *L)
 
void SetMapValue (unsigned x, unsigned y, a_type p)
 
 ~IDMap ()
 

Public Attributes

vector< a_type > m_TheMap
 
int maxx
 
int maxy
 

Detailed Description

template<class a_type>
class IDMap< a_type >

Used to map locations of animals in space.

Constructor & Destructor Documentation

template<class a_type>
IDMap< a_type >::IDMap ( Landscape L)
inline
111  {
112  maxx = L->SupplySimAreaWidth();
113  maxy = L->SupplySimAreaHeight();
114  m_TheMap.resize(maxx*maxy);
115  for (int y = 0; y<maxy; y++) {
116  for (int x = 0; x<maxx; x++) {
117  SetMapValue(x, y, NULL);
118  }
119  }
120  }
void SetMapValue(unsigned x, unsigned y, a_type p)
Definition: MovementMap.h:105
vector< a_type > m_TheMap
Definition: MovementMap.h:99
int SupplySimAreaWidth(void)
Definition: landscape.h:1556
int maxy
Definition: MovementMap.h:101
int SupplySimAreaHeight(void)
Definition: landscape.h:1561
int maxx
Definition: MovementMap.h:100
template<class a_type>
IDMap< a_type >::~IDMap ( )
inline
121  {
122  ;
123  }

Member Function Documentation

template<class a_type>
void IDMap< a_type >::ClearMapValue ( unsigned  x,
unsigned  y 
)
inline
108  {
109  m_TheMap[x + (maxx*y)] = NULL;
110  }
vector< a_type > m_TheMap
Definition: MovementMap.h:99
int maxx
Definition: MovementMap.h:100
template<class a_type>
a_type IDMap< a_type >::GetMapValue ( unsigned  x,
unsigned  y 
)
inline
102  {
103  return m_TheMap[x + (maxx*y)];
104  }
vector< a_type > m_TheMap
Definition: MovementMap.h:99
int maxx
Definition: MovementMap.h:100
template<class a_type>
void IDMap< a_type >::SetMapValue ( unsigned  x,
unsigned  y,
a_type  p 
)
inline
105  {
106  m_TheMap[x + (maxx*y)] = p;
107  }
vector< a_type > m_TheMap
Definition: MovementMap.h:99
int maxx
Definition: MovementMap.h:100

Member Data Documentation

template<class a_type>
vector<a_type> IDMap< a_type >::m_TheMap
template<class a_type>
int IDMap< a_type >::maxx
template<class a_type>
int IDMap< a_type >::maxy

The documentation for this class was generated from the following file: