Package com.mygdx.game.Logic.Squares
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
-
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 >= 5float
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 thePlayer
lands on this squarevoid
setGrade(int grade)
void
upgrade(Player aPlayer)
Raises the course grade by one for the specified priceMethods 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. 4direction
- ex. ΕΤΥdescription
- ex. Αρχές Τεχνολογίας Λογισμικού. Προβλήματα στην ανάπτυξη έργων λογισμικού. Διαφορές από άλλα τεχνικά έργα....Professors
- ex. Χατζηγεωργίου Αλέξανδροςprice
- ex. 50
-
-
Method Details
-
runAction
To be run when thePlayer
lands on this square
Does nothing automatically, leaves it up to the UI -
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
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()
-