Examples of CircuitType


Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

   
    // Setting picker
    BlockReactorPart reactorPartBlock = (BlockReactorPart)BigReactors.blockReactorPart;
    int buttonOrdinal = MINIMUM_SETTING_SELECTOR_ID;
    leftX = guiLeft + 16;
    CircuitType currentCircuitType = port.getCircuitType();
    for(CircuitType ct : CircuitType.values()) {
      if(ct == CircuitType.DISABLED) { continue; }
      GuiSelectableButton newBtn = new GuiSelectableButton(buttonOrdinal++, leftX, topY, reactorPartBlock.getRedNetConfigIcon(ct), 0xFF00FF00, this);
      newBtn.displayString = GuiReactorRedNetPort.grabbableTooltips[ct.ordinal()-1];
View Full Code Here

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

 
  @Override
  public void updateScreen() {
    super.updateScreen();
   
    CircuitType selectedSetting = getUserSelectedCircuitType();
    updateSubSettings(selectedSetting);
   
    if(selectedSetting == port.getCircuitType()) {
      int actualOutputLevel = this.outputLevel;
      if(selectedSetting == CircuitType.inputSetControlRod && this.greaterThan && this.retract) { actualOutputLevel *= -1; }
View Full Code Here

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

  }
 
  @Override
  protected void actionPerformed(GuiButton clickedButton) {
    if(clickedButton.id == 0) {
      CircuitType newCircuitType = getUserSelectedCircuitType();
      int actualOutputLevel = this.outputLevel;
      if(newCircuitType == CircuitType.inputSetControlRod && this.greaterThan && this.retract) { actualOutputLevel *= -1; }

            CommonPacketHandler.INSTANCE.sendToServer(new ReactorRedstonePortChangeMessage(port, newCircuitType.ordinal(), actualOutputLevel, this.greaterThan, this.activeOnPulse));
        }
    else if(clickedButton.id == 1) {
      for(Entry<CircuitType, GuiSelectableButton> pair : btnMap.entrySet()) {
        pair.getValue().setSelected(pair.getKey() == port.getCircuitType());
      }
     
      setSubSettingsToDefaults(port.getCircuitType());
    }
    else if(clickedButton.id == 2) {
      CircuitType selectedCircuitType = this.getUserSelectedCircuitType();
      if(TileEntityReactorRedNetPort.isInput(selectedCircuitType))
        this.activeOnPulse = !this.activeOnPulse;
      else
        this.greaterThan = !this.greaterThan;
    }
    else if(clickedButton.id == 3) {
      if(this.greaterThan && !this.retract) {
        // Insert -> Retract
        this.greaterThan = true;
        this.retract = true;
      }
      else if(this.greaterThan && this.retract) {
        // Retract -> Set
        this.greaterThan = false;
        this.retract = false;
      }
      else {
        // Set -> Insert
        this.greaterThan = true;
        this.retract = false; // Doesn't actually matter, but hey, keeping it tidy.
      }
    }
    else if(clickedButton.id >= MINIMUM_SETTING_SELECTOR_ID && clickedButton.id < MINIMUM_SETTING_SELECTOR_ID + btnMap.size()) {
      CircuitType ct = CircuitType.DISABLED;
      for(Entry<CircuitType, GuiSelectableButton> pair : btnMap.entrySet()) {
        GuiSelectableButton btn = pair.getValue();
        btn.setSelected(btn.id == clickedButton.id);

        if(btn.isSelected()) {
View Full Code Here

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

    // Pack in low-order bits
    this.outputLevel |= val1 & 0xFF;
  }
 
  private void validateOutputValues() {
    CircuitType selectedType = getUserSelectedCircuitType();
    int maxVal = Integer.MAX_VALUE;
    if(selectedType == CircuitType.outputFuelMix || selectedType == CircuitType.outputEnergyAmount) {
      // Percentile
      maxVal = 100;
    }
View Full Code Here

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

  private RedNetChange[] getUpdatePacketData() {
    List<RedNetChange> packetData = new LinkedList<RedNetChange>();

    for(int i = 0; i < TileEntityReactorRedNetPort.numChannels; i++) {
      if(hasSettingChanged(i)) {
        CircuitType circuitType = grabTargets[i].getCircuitType();
        RedNetChange change = new RedNetChange(i, circuitType, pulseActivated[i], subSettingCoords[i]);
        packetData.add(change);
      }
    }
   
View Full Code Here

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

  }

  public void onChannelChanged(int changedChannel) {
    if(this.selectedChannel != changedChannel) { return; }

    CircuitType currentCircuitType = grabTargets[selectedChannel].getCircuitType();
   
    if(CircuitType.hasCoordinate(currentCircuitType)) {
      subSettingString.setLabelText("Control Rod: ");
      subSettingForwardBtn.visible = true;
      subSettingBackBtn.visible = true;
View Full Code Here

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

      }
    }
  }

  private void changeSubSetting(boolean forward) {
    CircuitType circuitType = grabTargets[selectedChannel].getCircuitType();

    if( CircuitType.hasCoordinate(circuitType) ) {
      // Select a new control rod
      CoordTriplet[] controlRodLocations = port.getReactorController().getControlRodLocations();
      int newIdx = 0;
View Full Code Here

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

 
  private void updateSubSettingValueText() {
    subSettingValueString.setLabelTooltip("");

   
    CircuitType circuitType = grabTargets[selectedChannel].getCircuitType();

    if( CircuitType.hasCoordinate(circuitType) ) {
      subSettingValueString.setLabelText( getControlRodLabelFromLocation(circuitType, subSettingCoords[selectedChannel]) );
    }
    else if(TileEntityReactorRedNetPort.isInput(circuitType) && CircuitType.canBeToggledBetweenPulseAndNormal(circuitType)) {
View Full Code Here

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityReactorRedNetPort.CircuitType

    this.coord = coord;
  }
 
  public static RedNetChange fromBytes(ByteBuf buf) {
    int channelID = buf.readInt();
    CircuitType type = CircuitType.s_Types[buf.readInt()];
    boolean pulseOrToggle = false;

    if(CircuitType.canBeToggledBetweenPulseAndNormal(type)) {
      pulseOrToggle = buf.readBoolean();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.