Class Company
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.impl.Company
-
-
Field Summary
Fields Modifier and Type Field Description private javafx.beans.property.LongProperty
cash
private long
companyValue
private ICity
homeTown
private IPlayer
owner
private IJavaFXApplicationThreadExecution
threadExecutor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.LongProperty
cashProperty()
Retrieve the cash property.long
getCash()
Retrieve the cash avalable to the companyvoid
setOwner(IPlayer player)
void
updateCash(long diff)
Add or subtract some cash on the UI threadvoid
updateCashDirectly(long diff)
Add or subtract some cash directly.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.sahits.game.openpatrician.model.ICompany
getCompanyValue, getHomeTown, setCompanyValue
-
-
-
-
Field Detail
-
owner
private IPlayer owner
-
homeTown
private ICity homeTown
-
companyValue
private long companyValue
-
cash
private javafx.beans.property.LongProperty cash
-
threadExecutor
@Autowired private IJavaFXApplicationThreadExecution threadExecutor
-
-
Constructor Detail
-
Company
public Company(ICity homeTown, long cash, long random)
-
-
Method Detail
-
setOwner
public void setOwner(IPlayer player)
-
getCash
public long getCash()
Description copied from interface:ICompany
Retrieve the cash avalable to the company
-
updateCash
public void updateCash(long diff)
Add or subtract some cash on the UI thread- Specified by:
updateCash
in interfaceICompany
- Parameters:
diff
- amount of money that is transferred
-
updateCashDirectly
public void updateCashDirectly(long diff)
Add or subtract some cash directly. This method is intended for calls that do not originate in the UI.- Specified by:
updateCashDirectly
in interfaceICompany
- Parameters:
diff
- delta that is to be updated (positive or negative)
-
cashProperty
public javafx.beans.property.LongProperty cashProperty()
Description copied from interface:ICompany
Retrieve the cash property.- Specified by:
cashProperty
in interfaceICompany
- Returns:
- property
-
-