use of club.nsdn.nyasamarailway.network.TrainPacket in project NyaSamaRailway by NSDN.
the class NSC3AM method doEngine.
@Override
protected void doEngine() {
tmpPacket = new TrainPacket(getEnginePower(), getEngineBrake(), getEngineDir());
tmpPacket.highSpeed = isHighSpeed();
tmpPacket.Velocity = this.Velocity;
if (this.maxVelocity > 0) {
if (this.Velocity > this.maxVelocity && tmpEngineBrake == -1) {
tmpEngineBrake = getEngineBrake();
setEngineBrake(1);
} else if (this.Velocity > this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(1);
} else if (this.Velocity <= this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(tmpEngineBrake);
tmpEngineBrake = -1;
}
}
TrainController.doMotionWithEuler(tmpPacket, this, getMaxCartSpeedOnRail());
setEnginePrevVel(this.Velocity);
setEngineVel(tmpPacket.Velocity);
}
use of club.nsdn.nyasamarailway.network.TrainPacket in project NyaSamaRailway by NSDN.
the class NSPCT8J method doEngine.
@Override
protected void doEngine() {
tmpPacket = new TrainPacket(getEnginePower(), getEngineBrake(), getEngineDir());
tmpPacket.highSpeed = isHighSpeed();
tmpPacket.Velocity = this.Velocity;
if (this.maxVelocity > 0) {
if (this.Velocity > this.maxVelocity && tmpEngineBrake == -1) {
tmpEngineBrake = getEngineBrake();
setEngineBrake(1);
} else if (this.Velocity > this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(1);
} else if (this.Velocity <= this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(tmpEngineBrake);
tmpEngineBrake = -1;
}
}
if (getHighSpeedMode())
TrainController.doMotionWithAirHigh(tmpPacket, this);
else {
TrainController.doMotionWithAir(tmpPacket, this);
}
setEnginePrevVel(this.Velocity);
setEngineVel(tmpPacket.Velocity);
}
use of club.nsdn.nyasamarailway.network.TrainPacket in project NyaSamaRailway by NSDN.
the class NSPCT9M method doEngine.
@Override
protected void doEngine() {
tmpPacket = new TrainPacket(getEnginePower(), getEngineBrake(), getEngineDir());
tmpPacket.highSpeed = isHighSpeed();
tmpPacket.Velocity = this.Velocity;
if (this.maxVelocity > 0) {
if (this.Velocity > this.maxVelocity && tmpEngineBrake == -1) {
tmpEngineBrake = getEngineBrake();
setEngineBrake(1);
} else if (this.Velocity > this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(1);
} else if (this.Velocity <= this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(tmpEngineBrake);
tmpEngineBrake = -1;
}
}
TrainController.doMotionWithAir(tmpPacket, this);
setEnginePrevVel(this.Velocity);
setEngineVel(tmpPacket.Velocity);
}
use of club.nsdn.nyasamarailway.network.TrainPacket in project NyaSamaRailway by NSDN.
the class NSC2AM method doEngine.
@Override
protected void doEngine() {
tmpPacket = new TrainPacket(getEnginePower(), getEngineBrake(), getEngineDir());
tmpPacket.highSpeed = isHighSpeed();
tmpPacket.Velocity = this.Velocity;
if (this.maxVelocity > 0) {
if (this.Velocity > this.maxVelocity && tmpEngineBrake == -1) {
tmpEngineBrake = getEngineBrake();
setEngineBrake(1);
} else if (this.Velocity > this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(1);
} else if (this.Velocity <= this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(tmpEngineBrake);
tmpEngineBrake = -1;
}
}
TrainController.doMotionWithEuler(tmpPacket, this, getMaxCartSpeedOnRail());
setEnginePrevVel(this.Velocity);
setEngineVel(tmpPacket.Velocity);
}
use of club.nsdn.nyasamarailway.network.TrainPacket in project NyaSamaRailway by NSDN.
the class NSC3BM method doEngine.
@Override
protected void doEngine() {
tmpPacket = new TrainPacket(getEnginePower(), getEngineBrake(), getEngineDir());
tmpPacket.highSpeed = isHighSpeed();
tmpPacket.Velocity = this.Velocity;
if (this.maxVelocity > 0) {
if (this.Velocity > this.maxVelocity && tmpEngineBrake == -1) {
tmpEngineBrake = getEngineBrake();
setEngineBrake(1);
} else if (this.Velocity > this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(1);
} else if (this.Velocity <= this.maxVelocity && tmpEngineBrake != -1) {
setEngineBrake(tmpEngineBrake);
tmpEngineBrake = -1;
}
}
TrainController.doMotionWithEuler(tmpPacket, this, getMaxCartSpeedOnRail());
setEnginePrevVel(this.Velocity);
setEngineVel(tmpPacket.Velocity);
}
Aggregations