예제 #1
0
파일: Train.cs 프로젝트: wcp16/FreeTrainSDL
        /// <summary>
        /// Creates a new train and assigns it to a group.
        /// </summary>
        public Train(TrainGroup group, string _name, int length, TrainContribution _type, TrainController _controller)
            : base(group, _name)
        {
            this.type       = _type;
            this.controller = _controller;

            TrainCarContribution[] carTypes = type.Create(length);

            cars = new TrainCar[length];
            for (int i = 0; i < length; i++)
            {
                cars[i] = new TrainCar(this, carTypes[i], i);
            }

            calcNextTrainCarState = new CalcNextTrainCarState(this);
        }
예제 #2
0
파일: Train.cs 프로젝트: wcp16/FreeTrainSDL
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 public void OnDeserialization(object sender)
 {
     calcNextTrainCarState = new CalcNextTrainCarState(this);
 }