Module AM37

Class PlayerData

java.lang.Object
it.polimi.ingsw.dataClass.PlayerData

public class PlayerData
extends java.lang.Object
A data class for Player

It can be useful to send game information over the network, without any reference to the actual game object.

  • Constructor Summary

    Constructors 
    Constructor Description
    PlayerData​(java.lang.String name, Color color, java.util.List<Worker> workers, GodData god, Worker selectedWorker)
    Default constructor
  • Method Summary

    Modifier and Type Method Description
    Color getColor()
    color getter
    GodData getGod()
    god gettter
    java.lang.String getName()
    name getter
    Worker getSelectedWorker()
    selectedWorker getter
    java.util.List<Worker> getWorkers()
    workers getter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerData

      public PlayerData​(java.lang.String name, Color color, java.util.List<Worker> workers, GodData god, Worker selectedWorker)
      Default constructor
      Parameters:
      name - the player's username
      color - the player's workers' color
      workers - the player0s workers
      god - the player's god
      selectedWorker - the last worker selected to perform an action
  • Method Details

    • getSelectedWorker

      public Worker getSelectedWorker()
      selectedWorker getter
      Returns:
      the last worker selected to perform an action
    • getName

      public java.lang.String getName()
      name getter
      Returns:
      the player's username
    • getColor

      public Color getColor()
      color getter
      Returns:
      the player's workers' color
    • getWorkers

      public java.util.List<Worker> getWorkers()
      workers getter
      Returns:
      the player's workers
    • getGod

      public GodData getGod()
      god gettter
      Returns:
      the player's god