Skip to content

Commit

Permalink
Clean up indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Nov 19, 2023
1 parent fec2605 commit 66eef24
Show file tree
Hide file tree
Showing 65 changed files with 2,231 additions and 2,238 deletions.
4 changes: 2 additions & 2 deletions src/games/stendhal/client/IGameScreen.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2023 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -29,7 +29,7 @@ public interface IGameScreen {
/**
* Center the view.
*/
void center();
void center();

/**
* Set the offline indication state.
Expand Down
6 changes: 3 additions & 3 deletions src/games/stendhal/client/PerceptionDispatcher.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2023 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -37,7 +37,7 @@ public boolean onAdded(final RPObject object) {
public boolean onClear() {
boolean returnValue = false;
for (final IPerceptionListener l : listenerList) {
l.onClear();
l.onClear();

}
return returnValue;
Expand All @@ -47,7 +47,7 @@ public boolean onClear() {
public boolean onDeleted(final RPObject object) {
boolean returnValue = false;
for (final IPerceptionListener l : listenerList) {
l.onDeleted(object);
l.onDeleted(object);

}
return returnValue;
Expand Down
44 changes: 22 additions & 22 deletions src/games/stendhal/client/actions/SummonAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,25 @@ public boolean execute(final String[] params, final String remainder) {

if (str != null) {
if (str.matches("[0-9].*")) {
try {
final Integer num = Integer.valueOf(str);
try {
final Integer num = Integer.valueOf(str);

if (x == null) {
x = num;
} else if (y == null) {
y = num;
} else if (quantity == null) {
quantity = num;
} else {
nameBuilder.append(str);
}
} catch (final NumberFormatException e) {
ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Invalid number: " + str));
return true;
}
} else {
nameBuilder.append(str);
}
if (x == null) {
x = num;
} else if (y == null) {
y = num;
} else if (quantity == null) {
quantity = num;
} else {
nameBuilder.append(str);
}
} catch (final NumberFormatException e) {
ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Invalid number: " + str));
return true;
}
} else {
nameBuilder.append(str);
}
}
}

Expand All @@ -98,10 +98,10 @@ public boolean execute(final String[] params, final String remainder) {

if (x != null) {
if (y != null) {
summon.put(X, x);
summon.put(Y, y);
} else {
return false;
summon.put(X, x);
summon.put(Y, y);
} else {
return false;
}
} else {
summon.put(X, (int) User.get().getX());
Expand Down
16 changes: 8 additions & 8 deletions src/games/stendhal/client/actions/SummonAtAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ public boolean execute(final String[] params, final String remainder) {
String itemName;

// If there is a numeric expression, treat it as amount.
//TODO refactor with same code in DropAction.execute()
// TODO refactor with same code in DropAction.execute()
if (params[2].matches("[0-9].*")) {
try {
amount = Integer.parseInt(params[2]);
} catch (final NumberFormatException ex) {
ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Invalid amount: " + params[2]));
return true;
}
try {
amount = Integer.parseInt(params[2]);
} catch (final NumberFormatException ex) {
ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Invalid amount: " + params[2]));
return true;
}

itemName = remainder;
itemName = remainder;
} else {
amount = 1;
itemName = (params[2] + " " + remainder).trim();
Expand Down
12 changes: 6 additions & 6 deletions src/games/stendhal/client/gui/GameKeyHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* (C) Copyright 2003-2012 - Stendhal *
* (C) Copyright 2003-2023 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -271,11 +271,11 @@ private synchronized void processDirectionPress(final Direction direction,
}

if (client.addDirection(direction, facing)) {
// Movement prediction.
User user = User.get();
if (user != null) {
user.predictMovement(direction, facing);
}
// Movement prediction.
User user = User.get();
if (user != null) {
user.predictMovement(direction, facing);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/games/stendhal/client/gui/login/Encoder.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2023 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -33,7 +33,7 @@ public String decode(final String str) {
try {
// create a BitSet based on the binary representation
final BitSet nameSet = createBitSet(str);
// xor the BitSet with the key
// xor the BitSet with the key
nameSet.xor(key);

// turn the xor'd BitSet back into a String
Expand Down
6 changes: 3 additions & 3 deletions src/games/stendhal/client/gui/login/LoginDialog.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* (C) Copyright 2003 - 2015 Faiumoni e.V. *
* (C) Copyright 2003-2023 Faiumoni e.V. *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -149,7 +149,7 @@ public void windowClosing(WindowEvent e) {
c.insets = new Insets(4, 4, 15, 4);
// column
c.gridx = 0;
// row
// row
c.gridy = 0;
contentPane.add(l, c);

Expand Down Expand Up @@ -179,7 +179,7 @@ public void windowClosing(WindowEvent e) {
c.insets = new Insets(4, 4, 4, 4);
// column
c.gridx = 0;
// row
// row
c.gridy = 1;
contentPane.add(l, c);

Expand Down
26 changes: 13 additions & 13 deletions src/games/stendhal/client/gui/styled/StyledOptionPaneUI.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2023 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -112,23 +112,23 @@ private void cleanComponents(Component component) {

@Override
protected void addMessageComponents(Container container,
GridBagConstraints cons, Object msg, int maxll,
boolean internallyCreated) {
GridBagConstraints cons, Object msg, int maxll,
boolean internallyCreated) {
/*
* A workaround to the well known flaw in JLabel that the text
* can not be made selectable. Use a non editable JTextField
* instead with the defaults of JLabel.
*/
if (msg instanceof String) {
JTextArea text = new JTextArea((String) msg);
text.setEditable(false);
text.setBorder(null);
text.setOpaque(false);
text.setForeground(style.getForeground());
text.setFont(UIManager.getFont("Label.font"));
if (msg instanceof String) {
JTextArea text = new JTextArea((String) msg);
text.setEditable(false);
text.setBorder(null);
text.setOpaque(false);
text.setForeground(style.getForeground());
text.setFont(UIManager.getFont("Label.font"));

msg = text;
}
super.addMessageComponents(container, cons, msg, maxll, internallyCreated);
msg = text;
}
super.addMessageComponents(container, cons, msg, maxll, internallyCreated);
}
}
62 changes: 31 additions & 31 deletions src/games/stendhal/client/sound/facade/AudibleCircleArea.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2023 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand All @@ -23,49 +23,49 @@
*/
public class AudibleCircleArea implements AudibleArea
{
private final float[] mCenter;
private float mInnerRadius;
private float mOuterRadius;
private final float[] mCenter;
private float mInnerRadius;
private float mOuterRadius;

public AudibleCircleArea(float[] center, float innerRadius, float outerRadius)
{
mCenter = new float[center.length];
System.arraycopy(center, 0, mCenter, 0, center.length);
mInnerRadius = innerRadius;
mOuterRadius = outerRadius;
}
public AudibleCircleArea(float[] center, float innerRadius, float outerRadius)
{
mCenter = new float[center.length];
System.arraycopy(center, 0, mCenter, 0, center.length);
mInnerRadius = innerRadius;
mOuterRadius = outerRadius;
}

public void setArea(float innerRadius, float outerRadius)
{
mInnerRadius = innerRadius;
mOuterRadius = outerRadius;
}
public void setArea(float innerRadius, float outerRadius)
{
mInnerRadius = innerRadius;
mOuterRadius = outerRadius;
}

public void setPosition (float[] position) { Algebra.mov_Vecf(mCenter, position); }
public void getPosition (float[] result) { Algebra.mov_Vecf(result, mCenter); }
public float getInnerRadius() { return mInnerRadius; }
public float getOuterRadius() { return mOuterRadius; }
public void setPosition (float[] position) { Algebra.mov_Vecf(mCenter, position); }
public void getPosition (float[] result) { Algebra.mov_Vecf(result, mCenter); }
public float getInnerRadius() { return mInnerRadius; }
public float getOuterRadius() { return mOuterRadius; }

@Override
@Override
public float getHearingIntensity(float[] hearerPos)
{
float distance = Algebra.distanceSqrt_Vecf(hearerPos, mCenter);
{
float distance = Algebra.distanceSqrt_Vecf(hearerPos, mCenter);

if(distance > (mOuterRadius * mOuterRadius)) {
if(distance > (mOuterRadius * mOuterRadius)) {
return 0.0f;
} else if(distance < (mInnerRadius * mInnerRadius)) {
return 1.0f;
}

distance = (float)Math.sqrt(distance) - mInnerRadius;
return 1.0f - distance / (mOuterRadius - mInnerRadius);
}
distance = (float)Math.sqrt(distance) - mInnerRadius;
return 1.0f - distance / (mOuterRadius - mInnerRadius);
}

@Override
@Override
public void getClosestPoint(float[] result, float[] hearerPos)
{
Geometry.closestPoint_SpherePointf(result, mCenter, mInnerRadius, hearerPos);
}
{
Geometry.closestPoint_SpherePointf(result, mCenter, mInnerRadius, hearerPos);
}

@Override
public String toString() {
Expand Down
Loading

0 comments on commit 66eef24

Please sign in to comment.