mirror of
				https://github.com/inf112-v20/Fiasko.git
				synced 2025-10-31 01:33:43 +01:00 
			
		
		
		
	Kjører automtisk forbedring av importeringer og formatering
This commit is contained in:
		| @@ -18,7 +18,7 @@ import inf112.fiasko.roborally.gamewrapper.SimpleButton; | ||||
| import inf112.fiasko.roborally.objects.ProgrammingCard; | ||||
| import inf112.fiasko.roborally.objects.ProgrammingCardDeck; | ||||
|  | ||||
| import javax.swing.JOptionPane; | ||||
| import javax.swing.*; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
|   | ||||
| @@ -9,12 +9,12 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton; | ||||
| import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; | ||||
| import com.badlogic.gdx.utils.Array; | ||||
| import com.badlogic.gdx.utils.viewport.FitViewport; | ||||
| import com.esotericsoftware.kryonet.Connection; | ||||
| import inf112.fiasko.roborally.gamewrapper.RoboRallyWrapper; | ||||
| import inf112.fiasko.roborally.gamewrapper.SimpleButton; | ||||
| import inf112.fiasko.roborally.networking.containers.GameStartInfoResponse; | ||||
| import inf112.fiasko.roborally.objects.Player; | ||||
| import inf112.fiasko.roborally.utility.IOUtil; | ||||
| import com.esotericsoftware.kryonet.Connection; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|   | ||||
| @@ -874,7 +874,7 @@ public class Board { | ||||
|     /** | ||||
|      * Gets the new particle to use given the laser firing and the existing beam particle | ||||
|      * | ||||
|      * @param laserBeam The laser beam which is fired | ||||
|      * @param laserBeam    The laser beam which is fired | ||||
|      * @param existingBeam The laser beam which already exists at a tile | ||||
|      * @return The particle which is a combination of the two | ||||
|      */ | ||||
| @@ -887,7 +887,7 @@ public class Board { | ||||
|         int forwardBeamsLaser = getNumberOfForwardBeams(laserBeamType); | ||||
|         int crossingBeamsLaser = getNumberOfPerpendicularBeams(laserBeamType); | ||||
|         int forwardBeamsExisting = getNumberOfForwardBeams(existingBeamType); | ||||
|         int crossingBeamsExisting  = getNumberOfPerpendicularBeams(existingBeamType); | ||||
|         int crossingBeamsExisting = getNumberOfPerpendicularBeams(existingBeamType); | ||||
|  | ||||
|         //Flip number of beams if beams are perpendicular | ||||
|         if (Direction.arePerpendicular(laserDirection, existingDirection)) { | ||||
| @@ -923,12 +923,12 @@ public class Board { | ||||
|     /** | ||||
|      * Gets the correct number of beams given existing beams and the beams to add | ||||
|      * | ||||
|      * @param newBeams The beam count of the new beam to add | ||||
|      * @param newBeams      The beam count of the new beam to add | ||||
|      * @param existingBeams The beam count of the existing beam | ||||
|      * @return The new number/thickness of beams/the beam | ||||
|      */ | ||||
|     private int getNumberOfBeams(int newBeams, int existingBeams) { | ||||
|         if ((newBeams + existingBeams) != 0 &&(newBeams + existingBeams) % 3 == 0) { | ||||
|         if ((newBeams + existingBeams) != 0 && (newBeams + existingBeams) % 3 == 0) { | ||||
|             return 3; | ||||
|         } else { | ||||
|             return Math.max(newBeams, existingBeams); | ||||
| @@ -937,7 +937,8 @@ public class Board { | ||||
|  | ||||
|     /** | ||||
|      * Gets a new particle type with the given number of beams | ||||
|      * @param forwardBeams The number of beams in the direction of the laser | ||||
|      * | ||||
|      * @param forwardBeams       The number of beams in the direction of the laser | ||||
|      * @param perpendicularBeams The number of beams in the perpendicular direction of the laser | ||||
|      * @return The correct particle type to be displayed | ||||
|      */ | ||||
|   | ||||
| @@ -5,12 +5,15 @@ import inf112.fiasko.roborally.elementproperties.TileType; | ||||
| import inf112.fiasko.roborally.elementproperties.WallType; | ||||
| import inf112.fiasko.roborally.objects.Board; | ||||
| import inf112.fiasko.roborally.objects.Grid; | ||||
| import inf112.fiasko.roborally.objects.ListGrid; | ||||
| import inf112.fiasko.roborally.objects.Robot; | ||||
| import inf112.fiasko.roborally.objects.Tile; | ||||
| import inf112.fiasko.roborally.objects.Wall; | ||||
| import inf112.fiasko.roborally.objects.ListGrid; | ||||
|  | ||||
| import java.io.*; | ||||
| import java.io.BufferedReader; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.io.InputStreamReader; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|   | ||||
| @@ -1,17 +1,17 @@ | ||||
| package inf112.fiasko.roborally.utility; | ||||
|  | ||||
| import com.badlogic.gdx.graphics.g2d.TextureRegion; | ||||
| import com.esotericsoftware.kryonet.Connection; | ||||
| import inf112.fiasko.roborally.elementproperties.Direction; | ||||
| import inf112.fiasko.roborally.elementproperties.Position; | ||||
| import inf112.fiasko.roborally.elementproperties.RobotID; | ||||
| import inf112.fiasko.roborally.objects.Player; | ||||
| import inf112.fiasko.roborally.objects.Tile; | ||||
| import inf112.fiasko.roborally.objects.DrawableGame; | ||||
| import inf112.fiasko.roborally.objects.Wall; | ||||
| import inf112.fiasko.roborally.objects.Particle; | ||||
| import inf112.fiasko.roborally.objects.Robot; | ||||
| import inf112.fiasko.roborally.objects.DrawableObject; | ||||
| import com.esotericsoftware.kryonet.Connection; | ||||
| import inf112.fiasko.roborally.objects.Particle; | ||||
| import inf112.fiasko.roborally.objects.Player; | ||||
| import inf112.fiasko.roborally.objects.Robot; | ||||
| import inf112.fiasko.roborally.objects.Tile; | ||||
| import inf112.fiasko.roborally.objects.Wall; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|   | ||||
| @@ -19,23 +19,21 @@ | ||||
|  | ||||
| package inf112.fiasko.roborally; | ||||
|  | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import com.badlogic.gdx.ApplicationListener; | ||||
| import com.badlogic.gdx.Gdx; | ||||
| import com.badlogic.gdx.backends.headless.HeadlessApplication; | ||||
| import com.badlogic.gdx.backends.headless.HeadlessApplicationConfiguration; | ||||
| import com.badlogic.gdx.graphics.GL20; | ||||
| import org.junit.runner.notification.RunNotifier; | ||||
| import org.junit.runners.BlockJUnit4ClassRunner; | ||||
| import org.junit.runners.model.FrameworkMethod; | ||||
| import org.junit.runners.model.InitializationError; | ||||
|  | ||||
| import com.badlogic.gdx.Gdx; | ||||
| import com.badlogic.gdx.graphics.GL20; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import static org.mockito.Mockito.mock; | ||||
|  | ||||
| import com.badlogic.gdx.ApplicationListener; | ||||
| import com.badlogic.gdx.backends.headless.HeadlessApplication; | ||||
| import com.badlogic.gdx.backends.headless.HeadlessApplicationConfiguration; | ||||
|  | ||||
| public class GdxTestRunner extends BlockJUnit4ClassRunner implements ApplicationListener { | ||||
|  | ||||
|     private final Map<FrameworkMethod, RunNotifier> invokeInRender = new HashMap<>(); | ||||
|   | ||||
| @@ -10,9 +10,9 @@ import org.junit.BeforeClass; | ||||
| import org.junit.Test; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.Map; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.function.Predicate; | ||||
|  | ||||
| import static org.junit.Assert.assertEquals; | ||||
|   | ||||
| @@ -9,8 +9,8 @@ import org.junit.Test; | ||||
| import org.junit.runner.RunWith; | ||||
|  | ||||
| import static org.junit.Assert.assertEquals; | ||||
| import static org.junit.Assert.assertSame; | ||||
| import static org.junit.Assert.assertFalse; | ||||
| import static org.junit.Assert.assertSame; | ||||
|  | ||||
| @RunWith(GdxTestRunner.class) | ||||
| public class DrawableObjectTest { | ||||
|   | ||||
| @@ -427,8 +427,8 @@ public class PhaseTest { | ||||
|     /** | ||||
|      * Loads a board to the variable and creates a new phase | ||||
|      * | ||||
|      * @param players A list of players participating in the game | ||||
|      * @param robots  A list of robots on the board | ||||
|      * @param players   A list of players participating in the game | ||||
|      * @param robots    A list of robots on the board | ||||
|      * @param boardName The name of the board to load | ||||
|      * @return A phase object | ||||
|      */ | ||||
|   | ||||
| @@ -5,15 +5,15 @@ import inf112.fiasko.roborally.utility.DeckLoaderUtil; | ||||
| import org.junit.Before; | ||||
| import org.junit.Test; | ||||
|  | ||||
| import java.io.IOException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import static org.junit.Assert.assertEquals; | ||||
| import static org.junit.Assert.assertFalse; | ||||
| import static org.junit.Assert.assertTrue; | ||||
| import static org.junit.Assert.fail; | ||||
|  | ||||
| import java.io.IOException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| public class ProgrammingCardDeckTest { | ||||
|     private ProgrammingCard programmingCard1; | ||||
|     private ProgrammingCard programmingCard3; | ||||
|   | ||||
| @@ -1,12 +1,11 @@ | ||||
| package inf112.fiasko.roborally.objects; | ||||
|  | ||||
| import inf112.fiasko.roborally.elementproperties.Action; | ||||
|  | ||||
| import static org.junit.Assert.assertEquals; | ||||
|  | ||||
| import org.junit.Before; | ||||
| import org.junit.Test; | ||||
|  | ||||
| import static org.junit.Assert.assertEquals; | ||||
|  | ||||
| public class ProgrammingCardTest { | ||||
|  | ||||
|     private ProgrammingCard programmingCard1; | ||||
|   | ||||
| @@ -1,10 +1,5 @@ | ||||
| package inf112.fiasko.roborally.objects; | ||||
|  | ||||
| import static junit.framework.TestCase.assertEquals; | ||||
| import static junit.framework.TestCase.assertNull; | ||||
| import static org.junit.Assert.assertFalse; | ||||
| import static org.junit.Assert.assertTrue; | ||||
|  | ||||
| import inf112.fiasko.roborally.elementproperties.Action; | ||||
| import inf112.fiasko.roborally.elementproperties.GameState; | ||||
| import org.junit.Before; | ||||
| @@ -13,6 +8,11 @@ import org.junit.Test; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import static junit.framework.TestCase.assertEquals; | ||||
| import static junit.framework.TestCase.assertNull; | ||||
| import static org.junit.Assert.assertFalse; | ||||
| import static org.junit.Assert.assertTrue; | ||||
|  | ||||
| public class RoboRallyGameTest { | ||||
|     private RoboRallyGame game; | ||||
|  | ||||
|   | ||||
| @@ -1,13 +1,12 @@ | ||||
| package inf112.fiasko.roborally.objects; | ||||
|  | ||||
| import inf112.fiasko.roborally.elementproperties.Position; | ||||
|  | ||||
| import static org.junit.Assert.assertEquals; | ||||
|  | ||||
| import inf112.fiasko.roborally.elementproperties.RobotID; | ||||
| import org.junit.Before; | ||||
| import org.junit.Test; | ||||
|  | ||||
| import static org.junit.Assert.assertEquals; | ||||
|  | ||||
| public class RobotTest { | ||||
|     private final int nextFlag = 1; | ||||
|     private Position robotPosition; | ||||
|   | ||||
| @@ -2,11 +2,10 @@ package inf112.fiasko.roborally.objects; | ||||
|  | ||||
| import inf112.fiasko.roborally.elementproperties.Direction; | ||||
| import inf112.fiasko.roborally.elementproperties.WallType; | ||||
| import org.junit.Test; | ||||
|  | ||||
| import static org.junit.Assert.assertEquals; | ||||
|  | ||||
| import org.junit.Test; | ||||
|  | ||||
| public class WallTest { | ||||
|     @Test | ||||
|     public void testWallGetWallTypeNormal() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user