Example #1
0
        private bool DoesItFit(AbstractBoat boat, int startX, int startY, bool horizontal)
        {
            if (horizontal)
            {
                //Past de boot hier uberhaupt?
                if (!((startX + boat.length) <= Width))
                {
                    return(false);
                }

                //Door alle grid-items loopen en kijken of er een boot ligt
                for (int i = startX; i < (startX + boat.length); i++)
                {
                    if (TileSet[startY][i] is BoatFragment)
                    {
                        return(false);
                    }
                }

                return(true);
            }
            else
            {
                //Past de boot hier uberhaupt?
                if (!((startY + boat.length) <= Height))
                {
                    return(false);
                }

                //Door alle grid-items loopen en kijken of er een boot ligt
                for (int i = startY; i < (startY + boat.length); i++)
                {
                    if (TileSet[i][startX] is BoatFragment)
                    {
                        return(false);
                    }
                }

                return(true);
            }
        }
Example #2
0
        private bool DoesItFit(AbstractBoat boat, List <Tuple <int, int> > fragments)
        {
            //Hier iets doen!

            return(true);
        }