public bool CanPlaceBlackStone(Field field) { return field.IsEmpty && FieldIsInMiddleRows(field) && FieldIsInMiddleColumns(field); }
public Tuple<int, int> GetCoordinates(Field field) { int row = field.Id/ColumnCount; int column = field.Id%ColumnCount; return Tuple.Create(row, column); }
private Field GetNewField(int row, int col) { int index = GetFieldIndex(row, col); var field = new Field(index, row, col); if (IsCentralField(row, col)) { field.PlaceWhiteStone(); _whiteField = field; } return field; }
private void UpdateField(Field field) { var fieldToUpdate = _fieldMap[field.Id]; fieldToUpdate.Stone = field.Stone; fieldToUpdate.Selected = field.Selected; _blackFields.Remove(fieldToUpdate); if(fieldToUpdate.HasWhiteStone) { _whiteField = fieldToUpdate; }else { if(fieldToUpdate.HasBlackStone) { _blackFields.Add(fieldToUpdate); } } }
private bool FieldIsInMiddleRows(Field field) { return field.IsInMiddleRows(RowCount); }
private bool FieldIsInMiddleColumns(Field field) { return field.IsInMiddleColumns(ColumnCount); }
public IStoneJumper GetStoneJumper(Field fromfield, Field toField) { return new StoneJumper(_fieldsGraph, fromfield, toField); }
public bool CanPlaceBlackStone(Field field) { return _fieldsGraph.CanPlaceBlackStone(field); }
public bool Equals(Field other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other._id == _id; }