Пример #1
0
        /*
         * Adds rail
         */
        public bool AddRail(string railname = "New Rail")
        {
            Rail rally = new Rail(railname);

            if (ContainsRail(rally.name))
            {
                return(false);
            }

            rails.Add(rally);
            return(true);
        }
Пример #2
0
        public Rail DeepCopy()
        {
            Rail ReturnRail = new Rail();

            ReturnRail.name   = name;
            ReturnRail.frames = new KeyFrame[frames.Length];
            for (int i = 0; i < frames.Length; i++)
            {
                ReturnRail.frames[i] = frames[i].DeepCopy();
            }
            return(ReturnRail);
        }
Пример #3
0
        /*
         * Loads data from file
         */
        public void Load(string filename)
        {
            if (file != null)
            {
                file.Close();
            }

            file = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite);

            bool done = false;

            while (!done)
            {
                Rail rl = new Rail();
                if (rl.ReadData(file))
                {
                    break;
                }
                rails.Add(rl);
            }
        }