Cleanup dans array2d et array3d
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
#include "define.h"
|
||||
|
||||
template <class T>
|
||||
class Array3d
|
||||
{
|
||||
class Array3d {
|
||||
public:
|
||||
Array3d(int x, int y, int z);
|
||||
~Array3d();
|
||||
@@ -16,12 +15,11 @@ class Array3d
|
||||
|
||||
void Reset(T type);
|
||||
|
||||
private:
|
||||
int To1dIndex(int x, int y, int z) const;
|
||||
|
||||
private:
|
||||
int m_x, m_y, m_z;
|
||||
T* m_array;
|
||||
|
||||
int To1dIndex(int x, int y, int z) const;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
@@ -43,9 +41,7 @@ void Array3d<T>::Set(int x, int y, int z, T type) {
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T Array3d<T>::Get(int x, int y, int z) const {
|
||||
return m_array[To1dIndex(x, y, z)];
|
||||
}
|
||||
T Array3d<T>::Get(int x, int y, int z) const { return m_array[To1dIndex(x, y, z)]; }
|
||||
|
||||
template <class T>
|
||||
void Array3d<T>::Reset(T type) {
|
||||
@@ -54,9 +50,6 @@ void Array3d<T>::Reset(T type) {
|
||||
}
|
||||
|
||||
template <class T>
|
||||
int Array3d<T>::To1dIndex(int x, int y, int z) const {
|
||||
return x + (z * m_x) + (y * m_z * m_x);
|
||||
}
|
||||
|
||||
int Array3d<T>::To1dIndex(int x, int y, int z) const { return x + (z * m_x) + (y * m_z * m_x); }
|
||||
|
||||
#endif // ARRAY3D_H__
|
||||
|
Reference in New Issue
Block a user