Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Loading...");
            ShipsExporter exp = new ShipsExporter();

            exp.Init();
            Console.WriteLine("Loaded {0} iterfaces", exp.ItemIterfacesCount());
            Console.WriteLine("Loaded {0} items", exp.ItemsCount());
            //  Console.WriteLine("Loaded {0} loadouts", exp.LoadoutsCount());
            Console.WriteLine("Loaded {0} ships", exp.ShipsCount());
            Console.WriteLine("------------------------------------------");

            if (exp.SuccessfullyLoaded)
            {
                foreach (ShipDefinition ship in exp.GetShips())
                {
                    if (ship.GetShipImplementation() != null)
                    {
                        //Console.WriteLine(ship.GetShipName());
                        EntityPrefab_CE54_Modded prefab = new EntityPrefab_CE54_Modded(exp);
                        XDocument xml          = prefab.GenerateShip(ship);
                        string    vehicleType  = ship.GetVehicleType();
                        string    manufacturer = ship.GetManufacturer();
                        Directory.CreateDirectory("exported/prefabs/" + vehicleType + "/" + manufacturer);
                        xml.Save("exported/prefabs/" + vehicleType + "/" + manufacturer + "/" + ship.GetShipName() + ".xml");
                        Console.WriteLine("SAVED: {0}", "exported/prefabs/" + vehicleType + "/" + manufacturer + "/" + ship.GetShipName() + ".xml");
                    }
                }
                Console.WriteLine("ALL EXPORTED");
            }
            else
            {
                Console.WriteLine("Copy Data.p4k/Data/ObjectContainers to data/ObjectContainers");
                Console.WriteLine("Copy Data.p4k/Data/Game.dcb to data/Game.dcb");
                Console.WriteLine("Copy Data.p4k/Data/Scripts to data/Scripts");
            }
            Console.Read();
        }
 public EntityPrefab_CE54(ShipsExporter exp)
 {
     exporter = exp;
 }