Skip to content

Commit

Permalink
#41 Add PlayerSocketID to Player Model for future usage
Browse files Browse the repository at this point in the history
  • Loading branch information
koflerm committed May 26, 2022
1 parent 79455a9 commit fefce77
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions core/src/playerLogic/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Player extends Actor {
private static float SIZE = Gdx.graphics.getHeight() / 15;

private int playerIndex;
private String playerSocketID;
private int money;
private Field currentPosition;
private SecureRandom secRand = new SecureRandom();
Expand All @@ -28,7 +29,7 @@ public Player() {

}

public Player(Field startingField, int playerIndex) {
public Player(Field startingField, int playerIndex, String playerSocketID) {
money = 1000000;
// movePath = new IntArray();
shares = new HashMap<>();
Expand All @@ -38,39 +39,40 @@ public Player(Field startingField, int playerIndex) {
this.setX(currentPosition.getX());
this.setY(currentPosition.getY());
playerTexture = new Texture("p" + playerIndex + "icon.png");
this.playerSocketID = playerSocketID;
}

//--------GETTERS-----------
public int getPlayerIndex() {
return playerIndex;
}

public String getPlayerSocketID() {
return playerSocketID;
}
public int getMoney() {
return money;
}

public int getAmountOfShare(Share shareName) {
return shares.get(shareName);
}

public Field getCurrentPosition() {
return currentPosition;
}

//--------------------------

//--------SETTERS-----------
public void setCurrentFieldPosition(Field field) {
this.currentPosition = field;
}

public void setPlayerSocketID(String playerSocketID) {
this.playerSocketID = playerSocketID;
}
public void setPlayerIndex(int playerIndex) {
this.playerIndex = playerIndex;
}

public void setMoney(int money) {
this.money = money;
}

public void setInitialRandomShares(int share_Index) {
switch (share_Index) {
case 1:
Expand Down

0 comments on commit fefce77

Please sign in to comment.