コード例 #1
0
        private static IAgent[] ExtractAndSave()
        {
            var blueprints = Blueprint.FromFile("D:\\Program Files (x86)\\Steam\\userdata\\39229456\\329130\\remote\\data\\save0\\blueprints.lua");

            Fleet[] fleets = new Fleet[blueprints.Count];

            for (int b = 0; b < blueprints.Count; b++)
            {
                Blueprint   blueprint  = blueprints[b];
                int         amount     = 8000 / blueprint.Cost;
                Blueprint[] individual = new Blueprint[amount];
                for (int i = 0; i < amount; i++)
                {
                    individual[i] = new Blueprint(blueprint.Name, blueprint.Cost, blueprint.GetRawData());
                }
                fleets[b] = new Fleet(blueprint.Name, blueprint.Cost * amount, individual);
                string raw = fleets[b].GetRawData();
            }

            SaveAgentsToDirectory(AppContext.BaseDirectory + "ExtractedShips", fleets);
            return(fleets);
        }