Ejemplo n.º 1
0
        static List <Color> GetKCLColors(byte[] byml)
        {
            var attributeFile = ByamlFile.FastLoadN(new MemoryStream(byml));

            var typeColors = new List <Color>();

            foreach (dynamic attrib in attributeFile.RootNode)
            {
                Console.WriteLine(attrib["FloorCode"]);
                switch (attrib["FloorCode"])
                {
                case "Ground":
                    typeColors.Add(Color.FromArgb(255, 200, 200, 200)); break;

                case "DamageFire":
                case "DamageFire2D":
                    typeColors.Add(Color.FromArgb(255, 200, 50, 0)); break;

                case "Poison":
                case "Poison2D":
                    typeColors.Add(Color.FromArgb(255, 255, 0, 200)); break;

                case "SandSink":
                    typeColors.Add(Color.FromArgb(255, 10, 30, 0)); break;

                case "Skate":
                    typeColors.Add(Color.FromArgb(255, 0, 220, 255)); break;

                default:
                    typeColors.Add(Color.FromArgb(255, 255, 255, 255)); break;
                }
            }
            return(typeColors);
        }