我有 2 个 C 语言结构:
struct CSquare
{
char Side;
int Row;
int Col;
};
struct CSide
{
char m_Side;
char m_Blocks[3][3];
CSquare *m_Moves;
};
和 C++ 代码:
int Count = 0;
int Flag = 0;
if (m_Down->m_Blocks[0][1] == *m_Down)
{
Count++;
Flag |= 2;
// type of m_Down is CSide
}
我正在尝试将它们转换为 C#:
public class Square
{
public char Side { get; set; }
public int Row { get; set; }
public int Col { get; set; }
}
public class CubeSide
{
private char Side { get; set; }
private char[,] _block = new char[3, 3];
private Square[] moves;
public char[,] Block
{
get { return _block; }
set { _block = value; }
}
internal Square[] Moves
{
get { return moves; }
set { moves = value; }
}
}
但我不知道如何转换行:
if (m_Down->m_Blocks[0][1] == *m_Down)
到 C#?
如何将此行转换为 C#?