changed a poorly named variable

This commit is contained in:
Diego Waxemberg
2013-12-30 22:19:09 -05:00
parent 5396ce03ed
commit db0eadf4d7
3 changed files with 25 additions and 25 deletions

View File

@@ -46,13 +46,13 @@ public class Gamepad implements DeviceListener {
return;
}
if (!mapped.contComp.isAnalog()) {
if (!mapped.padComp.isAnalog()) {
handleDigitalComponent(mapped, pressed);
} else {
handleAnalogComponent(mapped.contComp, sanitizeValue(mapped, pressed));
handleAnalogComponent(mapped.padComp, sanitizeValue(mapped, pressed));
}
//printInfo(device, new SourceComponent(Type.BUTTON, buttonId), mapped.contComp, pressed ? 1F : 0F);
//printInfo(device, new SourceComponent(Type.BUTTON, buttonId), mapped.padComp, pressed ? 1F : 0F);
}
@Override
@@ -67,13 +67,13 @@ public class Gamepad implements DeviceListener {
float value = sanitizeValue(mapped, newValue);
if (mapped.contComp.isAnalog()) {
handleAnalogComponent(mapped.contComp, value);
if (mapped.padComp.isAnalog()) {
handleAnalogComponent(mapped.padComp, value);
} else {
handleDigitalComponent(mapped, (value > 0.5));
}
//printInfo(device, new SourceComponent(Type.AXIS, axisId), mapped.contComp, newValue);
//printInfo(device, new SourceComponent(Type.AXIS, axisId), mapped.padComp, newValue);
}
private float sanitizeValue(Mapping mapped, boolean value) {
@@ -123,7 +123,7 @@ public class Gamepad implements DeviceListener {
private void handleDigitalComponent(Mapping mapped, boolean pressed) {
switch (mapped.contComp) {
switch (mapped.padComp) {
case BTN_A:
toggle(ControllerPacket.A_FLAG, pressed);
break;
@@ -170,7 +170,7 @@ public class Gamepad implements DeviceListener {
toggle(ControllerPacket.SPECIAL_BUTTON_FLAG, pressed);
break;
default:
System.out.println("A mapping error has occured. Ignoring: " + mapped.contComp.name());
System.out.println("A mapping error has occured. Ignoring: " + mapped.padComp.name());
return;
}
if (conn != null) {

View File

@@ -49,13 +49,13 @@ public class GamepadMapping implements Serializable {
/**
* Gets the mapped ControllerComponent for the specified ControllerComponent.</br>
* <b>NOTE: Iterates a hashmap, use sparingly</b>
* @param contComp the component to get a mapping for
* @param padComp the component to get a mapping for
* @return a mapping or an null if there is none
*/
public Mapping get(GamepadComponent contComp) {
public Mapping get(GamepadComponent padComp) {
//#allTheJank
for (Entry<SourceComponent, Mapping> entry : mapping.entrySet()) {
if (entry.getValue().contComp == contComp) {
if (entry.getValue().padComp == padComp) {
return entry.getValue();
}
}
@@ -65,12 +65,12 @@ public class GamepadMapping implements Serializable {
/**
* Gets the mapping for the specified component.</br>
* <b>NOTE: Iterates a hashmap, use sparingly</b>
* @param contComp the component to get a mapping for
* @param padComp the component to get a mapping for
* @return a mapping or an empty string if there is none
*/
public SourceComponent getMapping(GamepadComponent contComp) {
public SourceComponent getMapping(GamepadComponent padComp) {
for (Entry<SourceComponent, Mapping> entry : mapping.entrySet()) {
if (entry.getValue().contComp == contComp) {
if (entry.getValue().padComp == padComp) {
return entry.getKey();
}
}
@@ -87,7 +87,7 @@ public class GamepadMapping implements Serializable {
/**
* The component this mapping belongs to
*/
public GamepadComponent contComp;
public GamepadComponent padComp;
/**
* Whether the value of this component should be inverted
@@ -101,12 +101,12 @@ public class GamepadMapping implements Serializable {
/**
* Constructs a new mapping with the specified configuration
* @param contComp the component this mapping belongs to
* @param padComp the component this mapping belongs to
* @param invert whether the value should be inverted
* @param trigger whether this component should be treated as a trigger
*/
public Mapping(GamepadComponent contComp, boolean invert, boolean trigger) {
this.contComp = contComp;
public Mapping(GamepadComponent padComp, boolean invert, boolean trigger) {
this.padComp = padComp;
this.invert = invert;
this.trigger = trigger;
}