我正在努力学习目标c。
这都在我的 .m 文件中
@interface TetrisEngine ()
@property (nonatomic, readwrite) struct TetrisPiece *currPiece;
@end
struct TetrisPiece {
int name;
struct {
int colOff, rowOff;
} offsets[TetrisPieceRotations][TetrisPieceBlocks];
};
下一个人的内容应该不相关。我假设返回值是您需要查看的所有内容以提供帮助
static struct TetrisPiece pieces[TetrisNumPieces] = {...};
@implementation TetrisEngine
@synthesize currPiece;
- (void) nextPiece
currPiece = &pieces[ ((random() % (TetrisNumPieces * 113)) + 3) % TetrisNumPieces];
这就是我得到错误的地方: Incompatible pointer types assignmenting to 'struct TetrisPiece *' from 'struct TetrisPiece *'