コード例 #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);
 }