Class CourseSquare

java.lang.Object
com.mygdx.game.Logic.Squares.Square
com.mygdx.game.Logic.Squares.CourseSquare
All Implemented Interfaces:
java.io.Serializable

public class CourseSquare
extends Square
Square class that can be bought, upgraded and traded with other players. Represents courses in a university
See Also:
Serialized Form
  • Field Summary

    Fields inherited from class com.mygdx.game.Logic.Squares.Square

    name
  • Constructor Summary

    Constructors
    Constructor Description
    CourseSquare​(java.lang.String name, int semester, java.lang.String direction, java.lang.String description, java.lang.String Professors, int price)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getDescription()  
    java.lang.String getDirection()  
    int getGrade()
    If grade is >= 5
    float getPrice()  
    java.lang.String getProfessors()  
    int getSalary()
    To be used to calculate the a player's total salary.
    int[] getSalaryArray()  
    int getSemester()  
    int getUpgradeCost()  
    void runAction​(GameInstance game)
    To be run when the Player lands on this square
    void setGrade​(int grade)  
    void upgrade​(Player aPlayer)
    Raises the course grade by one for the specified price

    Methods inherited from class com.mygdx.game.Logic.Squares.Square

    getI, getJ, getName, setIJ, toString

    Methods inherited from class java.lang.Object

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

    • CourseSquare

      public CourseSquare​(java.lang.String name, int semester, java.lang.String direction, java.lang.String description, java.lang.String Professors, int price)
      Parameters:
      name - ex. ΤΕΧΝΟΛΟΓΙΑ ΛΟΓΙΣΜΙΚΟΥ (CSC402)
      semester - ex. 4
      direction - ex. ΕΤΥ
      description - ex. Αρχές Τεχνολογίας Λογισμικού. Προβλήματα στην ανάπτυξη έργων λογισμικού. Διαφορές από άλλα τεχνικά έργα....
      Professors - ex. Χατζηγεωργίου Αλέξανδρος
      price - ex. 50
  • Method Details

    • runAction

      public void runAction​(GameInstance game)
      To be run when the Player lands on this square
      Does nothing automatically, leaves it up to the UI
      Specified by:
      runAction in class Square
      Parameters:
      game - The current Game Instance
    • getSalary

      public int getSalary()
      To be used to calculate the a player's total salary.
      Returns:
      The salary of the square taking into account its grade
      See Also:
      Player.getStartSalary()
    • getUpgradeCost

      public int getUpgradeCost()
      Returns:
      0 when course fully upgraded or the price of the next upgrade
    • upgrade

      public void upgrade​(Player aPlayer)
      Raises the course grade by one for the specified price
      Parameters:
      aPlayer - player that owns the course
    • getSalaryArray

      public int[] getSalaryArray()
      Returns:
      the array of salaries for each grade to be displayed by the UI
    • getGrade

      public int getGrade()
      If grade is >= 5
      Returns:
      the grade of the course
    • setGrade

      public void setGrade​(int grade)
      Parameters:
      grade - Sets the grade of the course. normal values in [5,10]
    • getPrice

      public float getPrice()
    • getSemester

      public int getSemester()
    • getDirection

      public java.lang.String getDirection()
    • getDescription

      public java.lang.String getDescription()
    • getProfessors

      public java.lang.String getProfessors()