在 Surface.h 我有:
struct Surface{
bool isAllowedOnTile[TILETYPE_COUNT];
float moveBecomes; // When this is 0, it is ignored
float moveChange; // Is ignored if moveBecomes is non-zero
float affChange[ELEMENT_COUNT];
ID2D1BitmapBrush* pBrush;
};
在某些时候,我需要像这样初始化多个表面:
Surface surface[SURFACEBMP_COUNT];
surface[0].moveBecomes = 123;
surface[0].moveChange = 0;
surface[0].affChange[0]= 2.0f;
...
然后我想从我的程序中的任何地方访问surface[0]、surface[1]、surface[2]...。我怎么做?