public static void CreateGraphic(GraphicsDevice graphicsDevice, Action <RenderTarget2D, Vector2> draw) { if (!_actionHappened && KeyboardExtended.Current.WasSingleClick(Keys.P)) { _actionHappened = true; var dimensions = PngCreator.GetDimensions(Globals.Files.Values.SelectMany(f => f.ConcreteJoints)); var texture = PngCreator.GetTexture(dimensions, graphicsDevice); draw(texture, new Vector2(-dimensions.X, -dimensions.Y)); string pngFile = FileManager.GetPngFileName(Globals.CurrentShownNumber, Globals.CurrentFolder); PngCreator.Save(texture, pngFile); JpgCreator.ConvertPngToJpg(pngFile, FileManager.GetJpgFolder(Globals.CurrentFolder)); } }
static void Main(string[] args) { JsonCreator creatorJson = new JsonCreator(); PngCreator creatorPng = new PngCreator(); TxtCreator creatorTxt = new TxtCreator(); Console.WriteLine("Создание файлов с помощью фабрик: "); IDocument txt_1 = creatorTxt.CreateDocument(); IDocument json_1 = creatorTxt.CreateDocument(); IImageDocument png_1 = creatorPng.CreateImageDocument(); Console.ReadKey(); }