コード例 #1
0
        public static IInfluenceMap Test()
        {
            int           testWidth  = 16;
            int           testHeight = 24;
            int           agentCount = 1;
            IInfluenceMap map        = InfluenceMap.Create(testWidth, testHeight);

            Random rand = new Random(0);
            Rect   r;

            for (int i = 0; i < agentCount; ++i)
            {
                r.centreX    = (int)rand.RandomRangef(0, testWidth);
                r.centreY    = (int)rand.RandomRangef(0, testHeight);
                r.halfWidth  = (int)rand.RandomRangef(2, 6);
                r.halfHeight = (int)rand.RandomRangef(2, 6);
                map.QueueBlit(r, 1);
                map.QueueSetPixel(r.centreX, r.centreY, 9.99f);
            }

            map.QueueQueryForBestZero(10, 8);
            map.QueueSetPixel(1, 1, 9.99f);

            return(map);
        }
コード例 #2
0
        public static IInfluenceMap Create(int width, int height)
        {
            var result = new InfluenceMap(width, height);

            return(result);
        }