Ejemplo n.º 1
0
        public World()
        {
            // Setup all nodes
            NodeCreator nodeCreator = new NodeCreator(30, 30);

            this.nodeList = nodeCreator.GetNodeList();
            this.homeNode = nodeList[27];

            // Add a Sun
            Sun Sun = new Sun(0, 0, 0, 0, 0, 0, 100, 500);

            worldObjects.Add(Sun);

            // Init some robots to work with
            int RobotCount = 10;

            for (int i = RobotCount; i >= 0; i--)
            {
                CreateRobot(this.homeNode.x, 3.15, this.homeNode.z, this.homeNode);
            }

            // Set list that tracks wether a rack can be placed in a node
            foreach (Node n in nodeList)
            {
                if (n.type == "adj")
                {
                    this.rackPlacedList.Add(true);
                    this.unavailablePlaces.Add(Convert.ToInt32(n.NodeName));
                }
                else
                {
                    this.rackPlacedList.Add(false);
                }
            }

            // Init a transport to deliver and get racks
            CreateTransport(0, 5.0, -100);

            // Setup dijkstra method to calculate routes
            this.dijkstra = new Dijkstra(nodeList);
        }