Beispiel #1
0
        /// <summary>
        /// Returns a populated world grid for testing.
        /// </summary>
        /// <returns></returns>
        private WorldGrid GetPopulatedWorldGrid()
        {
            WorldGrid grid = new WorldGrid(800, 800, 200, 200);

            // Populate
            float[] posX = new float[]
            {
                250, 450, 650, 750,
                210, 450,
                500,
                50, 250, 750
            };
            float[] posY = new float[]
            {
                50, 50, 50, 150,
                300, 300,
                500,
                700, 700, 700
            };
            for (int i = 0; i < posX.Length; i++)
            {
                WorldComponent comp = new WorldComponent();
                comp.Entity                     = new Entity(i);
                comp.PositionComponent          = new PositionComponent();
                comp.PositionComponent.Position =
                    new Vector2(posX[i], posY[i]);

                grid.Add(comp);
            }

            return(grid);
        }