private void TakeOff(int from) { bool owlWasPresent = PositionsWithOwls.Remove(from); if (!owlWasPresent) { throw new InvalidMoveException("There is no owl at position " + from); } }
public void Move(int from, int to) { TakeOff(from); PositionsWithOwls.Add(to); }
public bool Inhabit(int position) { return(PositionsWithOwls.Contains(position)); }