Пример #1
0
 internal static void Load(SharpTag tag)
 {
     VolMaster    = tag.GetFloat("va");
     VolMusic     = tag.GetFloat("vm");
     VolSound     = tag.GetFloat("vs");
     Left         = (Keys)tag.GetInt("kl");
     Right        = (Keys)tag.GetInt("kr");
     Up           = (Keys)tag.GetInt("ku");
     Down         = (Keys)tag.GetInt("kd");
     Activate     = (Keys)tag.GetInt("ka");
     Cancel       = (Keys)tag.GetInt("kb");
     Start        = (Keys)tag.GetInt("kp");
     Select       = (Keys)tag.GetInt("ks");
     WindowWidth  = tag.GetInt("ww");
     WindowHeight = tag.GetInt("wh");
     WindowScale  = tag.GetFloat("ws");
 }
Пример #2
0
        public static Map Load(string name)
        {
            SharpTag tag = BitIO.FromFile(Path.Combine("Maps", name), false);

            Map ret = new Map()
            {
                Name   = tag.GetString("mapname"),
                Width  = tag.GetInt("mapwidth"),
                Height = tag.GetInt("mapheight")
            };

            ret.Tiles = new Sprite[ret.Width, ret.Height];

            for (int i = 0; i < ret.Width; i++)
            {
                for (int j = 0; j < ret.Height; j++)
                {
                    ret.Tiles[i, j] = Sprite.Load(tag.GetSharpTag($"maptile[{i},{j}]"));
                }
            }

            return(ret);
        }