static void Main(string[] args) { try { FigureExtractor.Parse(); var Parts = FigureExtractor.Parts; var figuredataReader = new FiguredataReader(); figuredataReader.LoadFigurePalettes(); figuredataReader.loadFigureSetTypes(); figuredataReader.LoadFigureSets(); figuredataReader.LoadOldFigureData(); //string figure = "hd-180-1.hr-100-.ch-260-62.lg-275-64.ha-1008-.ea-1402-.ca-1806-73"; string figure = "8024319001270152950823021"; Console.WriteLine("Parsing: " + figure); var action = "lay"; var gesture = "sml"; var item = 2; var avata = new Avatar(figure, false, 0, 0, figuredataReader, action, gesture, false, 1, item); File.WriteAllBytes("figure0-0.png", avata.Run()); var avatar0 = new Avatar(figure, false, 1, 1, figuredataReader, action, gesture, false, 1, item); File.WriteAllBytes("figure1-1.png", avatar0.Run()); var avatar = new Avatar(figure, false, 2, 2, figuredataReader, action, gesture, false, 1, item); File.WriteAllBytes("figure2-2.png", avatar.Run()); var avatar1 = new Avatar(figure, false, 3, 3, figuredataReader, action, gesture, false, 1, item); File.WriteAllBytes("figure3-3.png", avatar1.Run()); var avatar2 = new Avatar(figure, false, 4, 4, figuredataReader, action, gesture, false, 1, item); File.WriteAllBytes("figure4-4.png", avatar2.Run()); var avatar3 = new Avatar(figure, false, 5, 5, figuredataReader, action, gesture, false, 1, item); File.WriteAllBytes("figure5-5.png", avatar3.Run()); var avatar4 = new Avatar(figure, false, 6, 6, figuredataReader, action, gesture, false, 1, item); File.WriteAllBytes("figure6-6.png", avatar4.Run()); var avatar5 = new Avatar(figure, false, 7, 7, figuredataReader, action, gesture, false, 1, item); File.WriteAllBytes("figure7-7.png", avatar5.Run()); Console.WriteLine("Done"); } catch (Exception ex) { Console.WriteLine(ex); } Console.Read(); }
static void Main(string[] args) { try { FigureExtractor.Parse(); FigureExtractor.Parse(); FigureExtractor.Parse(); var Parts = FigureExtractor.Parts; var figuredataReader = new FiguredataReader(); figuredataReader.LoadFigurePalettes(); figuredataReader.loadFigureSetTypes(); figuredataReader.LoadFigureSets(); string figure = "hd-600-7.ch-645-66.lg-720-82.sh-725-80.hr-500-45"; //string figure = "hd-180-1.hr-100-.ch-260-62.lg-275-64.ea-1402-.ca-1806-73"; Console.WriteLine("Parsing: " + figure); var avatar = new Avatar(figure, "b", 1, 1, figuredataReader, gesture: "", action: "drk", carryDrink: 3); File.WriteAllBytes("figure1-1-drk.png", avatar.Run()); avatar = new Avatar(figure, "l", 2, 2, figuredataReader, gesture: "", action: "drk", carryDrink: 3); File.WriteAllBytes("figure2-2-drk.png", avatar.Run()); avatar = new Avatar(figure, "b", 3, 3, figuredataReader, gesture: "", action: "drk", carryDrink: 3); File.WriteAllBytes("figure3-3-drk.png", avatar.Run()); Console.WriteLine("Done"); } catch (Exception ex) { Console.WriteLine(ex); } Console.Read(); }
public IActionResult Index() { string figure = ""; if (Request.Query.ContainsKey("figure")) { Request.Query.TryGetValue("figure", out var value); figure = value.ToString(); } if (figuredataReader == null) { FigureExtractor.Parse(); figuredataReader = new FiguredataReader(); figuredataReader.LoadFigurePalettes(); figuredataReader.loadFigureSetTypes(); figuredataReader.LoadFigureSets(); } if (Regex.IsMatch(figure, @"^\d+$")) { figuredataReader.LoadOldFigureData(); } bool isSmall = false; int bodyDirection = 0; int headDirection = 0; string action = "std"; string gesture = "sml"; bool headOnly = false; int frame = 1; if (Request.Query.ContainsKey("action")) { Request.Query.TryGetValue("action", out var value); action = value.ToString(); } if (Request.Query.ContainsKey("gesture")) { Request.Query.TryGetValue("gesture", out var value); gesture = value.ToString(); } if (Request.Query.ContainsKey("figure")) { Request.Query.TryGetValue("figure", out var value); figure = value.ToString(); } if (Request.Query.ContainsKey("size")) { Request.Query.TryGetValue("size", out var value); if (value == "s") { isSmall = true; } } if (Request.Query.ContainsKey("head")) { Request.Query.TryGetValue("head", out var value); headOnly = value.ToString() == "1" || value.ToString() == "true"; } if (Request.Query.ContainsKey("direction")) { Request.Query.TryGetValue("direction", out var value); if (value.ToString().IsNumeric()) { bodyDirection = int.Parse(value.ToString()); } } if (Request.Query.ContainsKey("head_direction")) { Request.Query.TryGetValue("head_direction", out var value); if (value.ToString().IsNumeric()) { headDirection = int.Parse(value.ToString()); } } if (Request.Query.ContainsKey("frame")) { Request.Query.TryGetValue("frame", out var value); if (value.ToString().IsNumeric()) { int v = int.Parse(value.ToString()); frame = v < 1 ? 1 : v; } } if (figure != null && figure.Length > 0) { var furni = new Avatar(figure, isSmall, bodyDirection, headDirection, figuredataReader, action: action, gesture: gesture, headOnly: headOnly, frame: frame); return(File(furni.Run(), "image/png")); } return(null); }
public IActionResult Index() { if (figuredataReader == null) { FigureExtractor.Parse(); figuredataReader = new FiguredataReader(); figuredataReader.LoadFigurePalettes(); figuredataReader.loadFigureSetTypes(); figuredataReader.LoadFigureSets(); } string size = "b"; int bodyDirection = 2; int headDirection = 2; string figure = null; string action = "std"; string gesture = "sml"; bool headOnly = false; int frame = 1; int carryDrink = -1; if (Request.Query.ContainsKey("figure")) { Request.Query.TryGetValue("figure", out var value); figure = value.ToString(); } if (Request.Query.ContainsKey("action")) { Request.Query.TryGetValue("action", out var value); action = value.ToString(); } if (Request.Query.ContainsKey("gesture")) { Request.Query.TryGetValue("gesture", out var value); gesture = value.ToString(); } if (Request.Query.ContainsKey("figure")) { Request.Query.TryGetValue("figure", out var value); figure = value.ToString(); } if (Request.Query.ContainsKey("size")) { Request.Query.TryGetValue("size", out var value); size = value.ToString(); } if (Request.Query.ContainsKey("head")) { Request.Query.TryGetValue("head", out var value); headOnly = value.ToString() == "1" || value.ToString() == "true"; } if (Request.Query.ContainsKey("direction")) { Request.Query.TryGetValue("direction", out var value); if (value.ToString().IsNumeric()) { bodyDirection = int.Parse(value.ToString()); } } if (Request.Query.ContainsKey("head_direction")) { Request.Query.TryGetValue("head_direction", out var value); if (value.ToString().IsNumeric()) { headDirection = int.Parse(value.ToString()); } } if (Request.Query.ContainsKey("frame")) { Request.Query.TryGetValue("frame", out var value); if (value.ToString().IsNumeric()) { int v = int.Parse(value.ToString()); frame = v < 1 ? 1 : v; } } if (Request.Query.ContainsKey("drk")) { Request.Query.TryGetValue("drk", out var value); action = (value.ToString() == "1" || value.ToString() == "true") ? "drk" : action; } if (Request.Query.ContainsKey("crr")) { Request.Query.TryGetValue("crr", out var value); if (value.ToString().IsNumeric()) { carryDrink = int.Parse(value.ToString()); } } if (figure != null && figure.Length > 0) { var furni = new Avatar(figure, size, bodyDirection, headDirection, figuredataReader, action: action, gesture: gesture, headOnly: headOnly, frame: frame, carryDrink: carryDrink); return(File(furni.Run(), "image/png")); } return(null); }