1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +00:00

fieldpattern:: matrix now based on std::array

This commit is contained in:
Zeno Rogue 2020-01-15 18:12:44 +01:00
parent 80b6b536fc
commit b12e1a71dd

View File

@ -37,11 +37,7 @@ EX bool isprime(int n) {
#if HDR #if HDR
#define MWDIM (prod ? 3 : WDIM+1) #define MWDIM (prod ? 3 : WDIM+1)
struct matrix { struct matrix : array<array<int, MAXMDIM>, MAXMDIM> {
int a[MAXMDIM][MAXMDIM];
int* operator [] (int k) { return a[k]; }
const int* operator [] (int k) const { return a[k]; }
bool operator == (const matrix& B) const { bool operator == (const matrix& B) const {
for(int i=0; i<MWDIM; i++) for(int j=0; j<MWDIM; j++) for(int i=0; i<MWDIM; i++) for(int j=0; j<MWDIM; j++)
if(self[i][j] != B[i][j]) return false; if(self[i][j] != B[i][j]) return false;