Exemple #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="group"></param>
 /// <param name="_name"></param>
 protected TrainItem(TrainGroup group, string _name)
 {
     this._ownerGroup = group;
     this.name        = _name;
     if (group != null)
     {
         group.items.add(this);
     }
 }
Exemple #2
0
        /// <summary> Move this group to a new train group </summary>
        public void moveUnder(TrainGroup newGroup)
        {
            if (ownerGroup != null)
            {
                _ownerGroup.items.remove(this);
            }

            _ownerGroup = newGroup;
            _ownerGroup.items.add(this);
        }
Exemple #3
0
        /// <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);
        }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="group"></param>
 /// <param name="length"></param>
 /// <param name="_type"></param>
 public Train(TrainGroup group, int length, TrainContribution _type)
     : this(group, string.Format("TR{0}", iota++), length, _type, SimpleTrainControllerImpl.theInstance)
 {
 }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="group"></param>
 public TrainGroup(TrainGroup group)
     : this(group, string.Format("Group {0}", iota++))
 {
     //! public TrainGroup(TrainGroup group) : this(group,string.Format("グループ{0}",iota++)) {
     controller = DelegationTrainControllerImpl.theInstance;
 }
Exemple #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="group"></param>
 /// <param name="name"></param>
 public TrainGroup(TrainGroup group, string name) : base(group, name)
 {
 }