public override void SetPropagationDirection(MechPowerPath path) { BlockFacing turnDir = path.NetworkDir(); if (this.turnDir1 != null) //rotate the input turn direction if it's an angled gear (this helps later blocks to know which sense the network is turning) { if (turnDir == turnDir1) { turnDir = turnDir2.Opposite; } else if (turnDir == turnDir2) { turnDir = turnDir1.Opposite; } else if (turnDir == turnDir2.Opposite) { turnDir = turnDir1; } else if (turnDir == turnDir1.Opposite) { turnDir = turnDir2; } path = new MechPowerPath(turnDir, path.gearingRatio, null, false); } base.SetPropagationDirection(path); }
public virtual void SetPropagationDirection(MechPowerPath path) { BlockFacing turnDir = path.NetworkDir(); if (this.propagationDir == turnDir.Opposite && this.network != null) { if (!network.DirectionHasReversed) { network.TurnDir = network.TurnDir == EnumRotDirection.Clockwise ? EnumRotDirection.Counterclockwise : EnumRotDirection.Clockwise; } network.DirectionHasReversed = true; } this.propagationDir = turnDir; this.GearedRatio = path.gearingRatio; if (DEBUG) { Api.Logger.Notification("setting dir " + this.propagationDir + " " + this.Position); } }
public override void SetPropagationDirection(MechPowerPath path) { BlockFacing turnDir = path.NetworkDir(); if (turnDir != BlockFacing.UP && turnDir != BlockFacing.DOWN) { turnDir = path.IsInvertedTowards(Position) ? BlockFacing.UP : BlockFacing.DOWN; //network coming in (clockwise) from any of the 4 sides should then propagate (clockwise) in the down direction this.GearedRatio = path.gearingRatio / ratio; } else { this.GearedRatio = path.gearingRatio; } if (this.propagationDir == turnDir.Opposite && this.network != null) { if (!network.DirectionHasReversed) { network.TurnDir = network.TurnDir == EnumRotDirection.Clockwise ? EnumRotDirection.Counterclockwise : EnumRotDirection.Clockwise; } network.DirectionHasReversed = true; } this.propagationDir = turnDir; }