mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
La til en funksjon som lager players.
This commit is contained in:
parent
51ca039a95
commit
5de72ba1a4
@ -3,20 +3,26 @@ package inf112.fiasko.roborally.utility;
|
|||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import inf112.fiasko.roborally.element_properties.Direction;
|
import inf112.fiasko.roborally.element_properties.Direction;
|
||||||
import inf112.fiasko.roborally.element_properties.Position;
|
import inf112.fiasko.roborally.element_properties.Position;
|
||||||
import inf112.fiasko.roborally.objects.IDrawableGame;
|
import inf112.fiasko.roborally.element_properties.RobotID;
|
||||||
import inf112.fiasko.roborally.objects.DrawableObject;
|
import inf112.fiasko.roborally.objects.*;
|
||||||
import inf112.fiasko.roborally.objects.IDrawableObject;
|
import com.esotericsoftware.kryonet.Connection;
|
||||||
import inf112.fiasko.roborally.objects.Particle;
|
|
||||||
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.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public final class IOUtil {
|
public final class IOUtil {
|
||||||
private IOUtil() {}
|
private IOUtil() {}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<Player> playerGenerator(Map<Connection, String> playerNames, Map<Connection, RobotID> robotIDs) {
|
||||||
|
List<Player> playerList = new ArrayList<>();
|
||||||
|
for (Connection connection: playerNames.keySet()) {
|
||||||
|
Player player = new Player(robotIDs.get(connection), playerNames.get(connection));
|
||||||
|
playerList.add(player);
|
||||||
|
}
|
||||||
|
return playerList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of all elements which should be drawn from the game provided
|
* Gets a list of all elements which should be drawn from the game provided
|
||||||
* @param game A game implementing IDrawableGame
|
* @param game A game implementing IDrawableGame
|
||||||
|
Loading…
x
Reference in New Issue
Block a user