mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-07 22:13:08 -04:00
Updated Housing service
Housing service detects if new citizen builds structure and adds him as citizen to the city
This commit is contained in:
@@ -90,6 +90,19 @@ public class PlayerCityService implements INetworkDispatch {
|
||||
return newCity;
|
||||
}
|
||||
|
||||
public PlayerCity getCityObjectIsIn(SWGObject object) {
|
||||
PlayerCity foundCity = null;
|
||||
synchronized(playerCities){
|
||||
for (PlayerCity city : playerCities){
|
||||
int radius = city.getCityRadius();
|
||||
if (object.getPosition().getDistance2D(city.getCityCenterPosition())<radius){
|
||||
foundCity = city;
|
||||
}
|
||||
}
|
||||
}
|
||||
return foundCity;
|
||||
}
|
||||
|
||||
public PlayerCity getPlayerCity(CreatureObject citizen) {
|
||||
PlayerCity foundCity = null;
|
||||
synchronized(playerCities){
|
||||
@@ -103,6 +116,8 @@ public class PlayerCityService implements INetworkDispatch {
|
||||
return foundCity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void newCitySUI1(CreatureObject citizen, final PlayerCity newCity) {
|
||||
final SUIWindow window = core.suiService.createSUIWindow("Script.messageBox", citizen, citizen, 0);
|
||||
window.setProperty("bg.caption.lblTitle:Text", "@city/city:rank0");
|
||||
|
||||
Reference in New Issue
Block a user