Class Trade

java.lang.Object
com.mygdx.game.Logic.Trade

public class Trade
extends java.lang.Object
Helper class that holds trade data and executes the trade between 2 players
  • Constructor Summary

    Constructors
    Constructor Description
    Trade​(Player sender, Player receiver)  
  • Method Summary

    Modifier and Type Method Description
    void accept()
    Executes the Trade
    void setReceiverOffer​(java.util.ArrayList<CourseSquare> rCourses, int rHours)
    Sets the Courses and Hours the receiver is to give
    void setSenderOffer​(java.util.ArrayList<CourseSquare> sCourses, int sHours)
    Sets the Courses and Hours the sender is to give

    Methods inherited from class java.lang.Object

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

    • Trade

      public Trade​(Player sender, Player receiver)
      Parameters:
      sender - The current Player or the one who initiated the trade
      receiver - The receiving Player or the one who has to accept the trade
  • Method Details

    • setSenderOffer

      public void setSenderOffer​(java.util.ArrayList<CourseSquare> sCourses, int sHours)
      Sets the Courses and Hours the sender is to give
      Parameters:
      sCourses - List of CourseSquare objects
      sHours - Number of hours
    • setReceiverOffer

      public void setReceiverOffer​(java.util.ArrayList<CourseSquare> rCourses, int rHours)
      Sets the Courses and Hours the receiver is to give
      Parameters:
      rCourses - List of CourseSquare objects
      rHours - Number of hours
    • accept

      public void accept()
      Executes the Trade