D
Daniel Lidström
Hello!
I have these following classes:
public struct Move
{
public int From { get; set; }
public int To { get; set; }
public int Captures { get; set; }
}
public class MoveList
{
private Move[] moves = new Move[32];
public int Length { get; private set; }
public void Add(Move move)
{
moves[Length++] = move;
}
public Move this[int index]
{
get
{
return moves[index];
}
}
}
MoveList seems to be a candidate for being a struct. However, I can't seem
to create a struct that contains an array. Is this possible? If so, how does
one do it?
Thanks in advance!
I have these following classes:
public struct Move
{
public int From { get; set; }
public int To { get; set; }
public int Captures { get; set; }
}
public class MoveList
{
private Move[] moves = new Move[32];
public int Length { get; private set; }
public void Add(Move move)
{
moves[Length++] = move;
}
public Move this[int index]
{
get
{
return moves[index];
}
}
}
MoveList seems to be a candidate for being a struct. However, I can't seem
to create a struct that contains an array. Is this possible? If so, how does
one do it?
Thanks in advance!