public Board(Board other) { values = new int[other.values.Length]; rows = new NineGroup[other.rows.Length]; columns = new NineGroup[other.columns.Length]; squares = new NineGroup[other.squares.Length]; Array.Copy(other.values, this.values, other.values.Length); for (int i = 0; i < rows.Length; ++i) { rows[i] = new NineGroup(this, other.rows[i]); columns[i] = new NineGroup(this, other.columns[i]); squares[i] = new NineGroup(this, other.squares[i]); } }
public override bool Equals(object obj) { NineGroup other = obj as NineGroup; if (other == null) { return(false); } foreach (Coord c in coords) { if (!other.Coords.Contains(c)) { return(false); } } return(true); }
public NineGroup(Board board, NineGroup other) : this(board, other.Coords) { }