Ejemplo n.º 1
0
        public Layer(string layer)
        {
            string[] param = layer.Split(' ');

            if (param.Length < 8)
            {
                string message = Words.Get(Key.ErrorFewParamsInLayer);
                string caption = Words.Get(Key.Exception);
                Err.Show(message, caption);

                return;
            }

            Tile.X      = Convert.ToInt32(param[0]);
            Tile.Y      = Convert.ToInt32(param[1]);
            Tile.Width  = Convert.ToInt32(param[2]);
            Tile.Height = Convert.ToInt32(param[3]);
            Offset.X    = Convert.ToInt32(param[4]);
            Offset.Y    = Convert.ToInt32(param[5]);
            ImageID     = Convert.ToInt32(param[6]);
            Frame       = param[7];
        }
Ejemplo n.º 2
0
        private static void Read()
        {
            if (File.Exists(currentLang))
            {
                string[] all = File.ReadAllLines(currentLang);
                word.Clear();

                for (int i = 0; i < all.Length; ++i)
                {
                    string[] pair = all[i].Split('=');
                    pair[0] = pair[0].Trim(new char[] { ' ', '"' });
                    pair[1] = pair[1].Trim(new char[] { ' ', '"' });

                    word.Add(pair[0], pair[1]);
                }

                Console.Write(' ');
            }
            else
            {
                Err.Show("Отсутствует файл языка\n", "Предупреждение");
            }
        }