示例#1
0
        protected override bool CanMove(Ocean aquarium, Point move)
        {
            var fishAtLocation = aquarium.GetFishAt(Location.X + move.X, Location.X + move.Y);

            return(fishAtLocation == this || fishAtLocation == null ||
                   fishAtLocation is SmallFish);
        }
示例#2
0
        protected override void MoveTo(Ocean ocean, Point location)
        {
            var fishAtLocation = ocean.GetFishAt(location.X, location.Y);

            if (fishAtLocation != null)
            {
                ocean.Remove(fishAtLocation);
            }

            ocean.MoveTo(this, location);
        }