protected TrainItem(TrainGroup group, string _name) { this._ownerGroup = group; this.name = _name; if (group != null) { group.items.add(this); } }
/// <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); }
/// <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); }
public Train(TrainGroup group, int length, TrainContribution _type) : this(group, string.Format("TR{0}", iota++), length, _type, SimpleTrainControllerImpl.theInstance) { }
public TrainGroup(TrainGroup group) : this(group, string.Format("Group {0}", iota++)) { //! public TrainGroup(TrainGroup group) : this(group,string.Format("グループ{0}",iota++)) { controller = DelegationTrainControllerImpl.theInstance; }
public TrainGroup(TrainGroup group, string name) : base(group, name) { }