Пример #1
0
        private void TakeOff(int from)
        {
            bool owlWasPresent = PositionsWithOwls.Remove(from);

            if (!owlWasPresent)
            {
                throw new InvalidMoveException("There is no owl at position " + from);
            }
        }
Пример #2
0
 public void Move(int from, int to)
 {
     TakeOff(from);
     PositionsWithOwls.Add(to);
 }
Пример #3
0
 public bool Inhabit(int position)
 {
     return(PositionsWithOwls.Contains(position));
 }