Skip to content

Commit

Permalink
Remove unnecessary public visibility modifier from interfaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen-wilke committed Jan 23, 2021
1 parent c8288e5 commit ddc1caf
Show file tree
Hide file tree
Showing 43 changed files with 289 additions and 289 deletions.
8 changes: 4 additions & 4 deletions src/de/gurkenlabs/litiengine/GameListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface GameListener extends EventListener {
*
* @see Game#start()
*/
public default void started() {}
default void started() {}

/**
* This method gets called after the {@code Game.init(String...)} method was executed.
Expand All @@ -21,20 +21,20 @@ public default void started() {}
* The arguments that were passed to the application.
* @see Game#init(String...)
*/
public default void initialized(String... args) {}
default void initialized(String... args) {}

/**
* This method gets called before the {@code Game} is about to be terminated.
* Returning false prevents the terminate event to continue.
*
* @return Return false to interrupt the termination process.
*/
public default boolean terminating() {
default boolean terminating() {
return true;
}

/**
* This method is called when the {@code Game} was terminated (just before {@code System.exit} is about to be called).
*/
public default void terminated() {}
default void terminated() {}
}
10 changes: 5 additions & 5 deletions src/de/gurkenlabs/litiengine/IGameLoop.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface IGameLoop extends ILoop {
*
* @see IGameLoop#alterExecutionTime(int, long)
*/
public int perform(int delay, Runnable action);
int perform(int delay, Runnable action);

/**
* Alters the execution time of the timed action with the specified index to the defined tick. This overwrites the originally specified delay.
Expand All @@ -26,22 +26,22 @@ public interface IGameLoop extends ILoop {
* @param tick
* The tick at which to perform the action instead.
*/
public void alterExecutionTime(int id, long tick);
void alterExecutionTime(int id, long tick);

/**
* Removes the {@code TimedAction} with the specified it.
*
* @param id
* The id of the {@code TimedAction}.
*/
public void removeAction(int id);
void removeAction(int id);

/**
* Gets the game loop's current time scale (default = 1).
*
* @return The game loop's current time scale.
*/
public float getTimeScale();
float getTimeScale();

/**
* Sets the game loop's time scale.
Expand All @@ -52,5 +52,5 @@ public interface IGameLoop extends ILoop {
* @param timeScale
* The time scale to set.
*/
public void setTimeScale(float timeScale);
void setTimeScale(float timeScale);
}
4 changes: 2 additions & 2 deletions src/de/gurkenlabs/litiengine/ILaunchable.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ public interface ILaunchable {
/**
* Starts the operation of this instance.
*/
public void start();
void start();

/**
* Terminates the operation of this instance.
*/
public void terminate();
void terminate();
}
18 changes: 9 additions & 9 deletions src/de/gurkenlabs/litiengine/ILoop.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ public interface ILoop extends ILaunchable {
* @param updatable
* The instance that will be registered for the update event.
*/
public void attach(final IUpdateable updatable);
void attach(final IUpdateable updatable);

/**
* Detaches the specified instance from the game loop.
*
* @param updatable
* The instance that will be unregistered for the update event.
*/
public void detach(final IUpdateable updatable);
void detach(final IUpdateable updatable);

/**
* Gets the amount of attached {@code IUpdatable} instances of this loop.
*
* @return The amount instances attached to this loop.
*/
public int getUpdatableCount();
int getUpdatableCount();

/**
* Gets the total amount of ticks performed by this loop since it was started.
Expand All @@ -45,14 +45,14 @@ public interface ILoop extends ILaunchable {
*
* @see #start()
*/
public long getTicks();
long getTicks();

/**
* Gets the rate at which this loop performs its updates.
*
* @return The update rate in ticks per second.
*/
public int getTickRate();
int getTickRate();

/**
* Gets the total time in milliseconds that passed since the last tick.
Expand All @@ -63,7 +63,7 @@ public interface ILoop extends ILaunchable {
*
* @see #getProcessTime()
*/
public long getDeltaTime();
long getDeltaTime();

/**
* Gets the actual process time in milliseconds that was required during the last tick.
Expand All @@ -74,20 +74,20 @@ public interface ILoop extends ILaunchable {
*
* @see #getDeltaTime()
*/
public double getProcessTime();
double getProcessTime();

/**
* Returns a lock that can be used for actions that must be performed either within or independently of the loop.
*
* @return A {@code Lock} for this loop.
*/
public Lock getLock();
Lock getLock();

/**
* Sets the tickrate at which the loop performs its updates.
*
* @param tickRate
* The tickrate of the loop.
*/
public void setTickRate(int tickRate);
void setTickRate(int tickRate);
}
2 changes: 1 addition & 1 deletion src/de/gurkenlabs/litiengine/IUpdateable.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ public interface IUpdateable {
*
* @see ClientConfiguration#setMaxFps(int)
*/
public void update();
void update();
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public interface CollisionListener extends EventListener {
* @see PhysicsEngine#move(IMobileEntity, double, double)
* @see CollisionEvent#getInvolvedEntities()
*/
public void collisionResolved(CollisionEvent event);
void collisionResolved(CollisionEvent event);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public interface CombatEntityDeathListener extends EventListener {
* @param entity
* The combat entity that died.
*/
public void death(ICombatEntity entity);
void death(ICombatEntity entity);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ public interface CombatEntityHitListener extends EventListener {
* @param event
* The event data that contains information about the entity, for how much it was hit and the ability that caused the hit.
*/
public void hit(EntityHitEvent event);
void hit(EntityHitEvent event);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public interface CombatEntityResurrectListener extends EventListener {
* @param entity
* The combat entity that was resurrected.
*/
public void resurrect(ICombatEntity entity);
void resurrect(ICombatEntity entity);
}
4 changes: 2 additions & 2 deletions src/de/gurkenlabs/litiengine/entities/Creature.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void removeMovedListener(EntityMovedListener listener) {
public float[] getTweenValues(TweenType tweenType) {
switch (tweenType) {
case VELOCITY:
return new float[] { (float) this.getVelocity().get() };
return new float[] { this.getVelocity().get() };
default:
return super.getTweenValues(tweenType);
}
Expand Down Expand Up @@ -188,7 +188,7 @@ public void setLocation(final Point2D position) {
if (this.isDead() || position == null) {
return;
}

final Point2D oldLocation = this.getLocation();
super.setLocation(position);

Expand Down
4 changes: 2 additions & 2 deletions src/de/gurkenlabs/litiengine/entities/EntityListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public interface EntityListener extends EventListener {

public default void loaded(IEntity entity, Environment environment) {}
default void loaded(IEntity entity, Environment environment) {}

public default void removed(IEntity entity, Environment environment) {}
default void removed(IEntity entity, Environment environment) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ public interface EntityMessageListener extends EventListener {
* @param event
* The event data that contains information about the received message and sender.
*/
public void messageReceived(EntityMessageEvent event);
void messageReceived(EntityMessageEvent event);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface EntityRenderListener extends EntityRenderedListener {
* @param event
* The event that contains the render data.
*/
public default void rendering(EntityRenderEvent event) {
default void rendering(EntityRenderEvent event) {
}

/**
Expand All @@ -26,7 +26,7 @@ public default void rendering(EntityRenderEvent event) {
*
* @return True if the entity should be rendered; otherwise false.
*/
public default boolean canRender(IEntity entity) {
default boolean canRender(IEntity entity) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ public interface EntityRenderedListener extends EventListener {
* @param event
* The event that contains the render data.
*/
public void rendered(EntityRenderEvent event);
void rendered(EntityRenderEvent event);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface EntityTransformListener extends EventListener {
* @see IEntity#setX(double)
* @see IEntity#setY(double)
*/
public default void locationChanged(IEntity entity) {}
default void locationChanged(IEntity entity) {}

/**
* This method is called whenever the size of an {@code IEntity} was changed.
Expand All @@ -30,5 +30,5 @@ public default void locationChanged(IEntity entity) {}
* @see IEntity#setHeight(double)
* @see IEntity#setWidth(double)
*/
public default void sizeChanged(IEntity entity) {}
default void sizeChanged(IEntity entity) {}
}
38 changes: 19 additions & 19 deletions src/de/gurkenlabs/litiengine/entities/ICollisionEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
import de.gurkenlabs.litiengine.physics.CollisionEvent;

public interface ICollisionEntity extends IEntity {
public void onCollision(CollisionListener listener);
void onCollision(CollisionListener listener);

public void removeCollisionListener(CollisionListener listener);
void removeCollisionListener(CollisionListener listener);

public void fireCollisionEvent(CollisionEvent event);
void fireCollisionEvent(CollisionEvent event);

public boolean canCollideWith(ICollisionEntity otherEntity);
boolean canCollideWith(ICollisionEntity otherEntity);

/**
* Gets the collision box.
*
* @return the collision box
*/
public Rectangle2D getCollisionBox();
Rectangle2D getCollisionBox();

/**
* Gets the collision box.
Expand All @@ -31,47 +31,47 @@ public interface ICollisionEntity extends IEntity {
* the location
* @return the collision box
*/
public Rectangle2D getCollisionBox(Point2D location);
Rectangle2D getCollisionBox(Point2D location);

/**
* Gets the center {@link Point2D} of the entities collision box.
*
* @return The center {@link Point2D} of the entities collision box
*/
public Point2D getCollisionBoxCenter();
Point2D getCollisionBoxCenter();

public Valign getCollisionBoxValign();
Valign getCollisionBoxValign();

public Align getCollisionBoxAlign();
Align getCollisionBoxAlign();

public Collision getCollisionType();
Collision getCollisionType();

public double getCollisionBoxHeight();
double getCollisionBoxHeight();

public double getCollisionBoxWidth();
double getCollisionBoxWidth();

/**
* Checks for collision.
*
* @return true, if successful
*/
public boolean hasCollision();
boolean hasCollision();

/**
* Sets the collision.
*
* @param collision
* the new collision
*/
public void setCollision(boolean collision);
void setCollision(boolean collision);

public void setCollisionBoxHeight(final double collisionBoxHeight);
void setCollisionBoxHeight(final double collisionBoxHeight);

public void setCollisionBoxWidth(final double collisionBoxWidth);
void setCollisionBoxWidth(final double collisionBoxWidth);

public void setCollisionBoxAlign(final Align align);
void setCollisionBoxAlign(final Align align);

public void setCollisionBoxValign(final Valign valign);
void setCollisionBoxValign(final Valign valign);

public void setCollisionType(Collision collisionType);
void setCollisionType(Collision collisionType);
}
Loading

0 comments on commit ddc1caf

Please sign in to comment.