Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Gender.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.example;

public enum Gender {
Male,
Female
}
102 changes: 102 additions & 0 deletions src/Home.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package org.example;

import java.util.Objects;

public class Home extends Property implements Cityinterface{

public String kind;
public int roomNo;
public int age;


public Home(int id, String title, String ownerID, String description, float value, float coordinate, boolean status, String kind, int roomNo, int age) {
super(id, title, ownerID, description, value, coordinate, status);
this.kind = kind;
this.roomNo = roomNo;
this.age = age;
this.id++;
}

public Home(){

}
public String getKind() {
return kind;
}

public void setKind(String kind) {
this.kind = kind;
}

public int getRoomNo() {
return roomNo;
}

public void setRoomNo(int roomNo) {
this.roomNo = roomNo;
}

public int getAge() {
return age;
}

public void setAge(int age) {
this.age = age;
}

@Override
public String toString() {
return "Home{" +
"kind='" + kind + '\'' +
", roomNo=" + roomNo +
", age=" + age +
", title='" + title + '\'' +
", owner-username=" + ownerusername +
", description='" + description + '\'' +
", value=" + value +
", coordinate=" + coordinate +
", status=" + status +
'}';
}

@Override
public void menu() {

}

@Override
public void buy() {

}

@Override
public void sell() {

}


public void UseProperty(String username) {

Avatar avatar = null;
for (Avatar i : Game.city.getAvatars()) {
if (Objects.equals(i.getUsername(), username)) {
avatar = i;
}
}
assert avatar != null;
avatar.setCoordinate(Game.city.getHomes().get(1).getCoordinate());
avatar.setHealth(avatar.health += 20);
// avatar.setFood(avatar.Food -= 5);
// avatar.setWater(avatar.Water -= 5);
DataBase.updateInfo("avatars", "health", username, avatar.health += 20);
// DataBase.updateInfo("avatars", "food", username, avatar.Food -= 5);
// DataBase.updateInfo("avatars", "water", username, avatar.Water -= 5);
DataBase.updateInfo("avatars", "coordinate", username, Game.city.getHomes().get(1).getCoordinate());
avatar.setSleep(100);
DataBase.updateInfo("avatars", "sleep", username, 100);
System.out.println("You sleep very well...");

}


}
42 changes: 42 additions & 0 deletions src/Job.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.example;

public class Job {

public String job;

public float income;

public int industryid;


public Job(String title, float income, int industryid) {
this.job = title;
this.income = income;
this.industryid = industryid;
}

public String getJob() {
return job;
}

public void setJob(String title) {
this.job = title;
}

public float getIncome() {
return income;
}

public void setIncome(float income) {
this.income = income;
}

public int getIndustryid() {
return industryid;
}

public void setIndustryid(int industryid) {
this.industryid = industryid;
}

}
122 changes: 122 additions & 0 deletions src/Land.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
package org.example;

import java.util.Objects;

public class Land extends Property implements Cityinterface{

public String kind;
public boolean status_for_use;

public Land(int id, String title, String ownerID, String description, float value, float coordinate, boolean status, String kind, boolean status_for_use) {
super(id, title, ownerID, description, value, coordinate, status);


if (Objects.equals(kind, "farming")){
status_for_use=false;
}
this.kind = kind;
this.status_for_use = status_for_use;
this.id++;
}

public void use(Land land){

if (Objects.equals(land.kind, "farming")){
land.status_for_use=false;
}

}


public void Land_to_Home (Land land){

if (land.isStatus_for_use()){
//home=new Home();
//remove land of id=......
//add home with id of that land
}

}
public void Land_to_Bank (Land land){
if (land.isStatus_for_use()) {
//home=new Home();
//remove land of id=......
//add home with id of that land
}
}
public void Land_to_Factory (Land land){
if (land.isStatus_for_use()) {
//home=new Home();
//remove land of id=......
//add home with id of that land
}
}
public void Land_to_Restaurant (Land land){
if (land.isStatus_for_use()) {
//home=new Home();
//remove land of id=......
//add home with id of that land
}
}
public void Land_to_Supermarket (Land land){
if (land.isStatus_for_use()) {
//home=new Home();
//remove land of id=......
//add home with id of that land
}
}

public String getKind() {
return kind;
}

public void setKind(String kind) {
this.kind = kind;
}

public boolean isStatus_for_use() {
return status_for_use;
}

public void setStatus_for_use(boolean status_for_use) {
this.status_for_use = status_for_use;
}

@Override
public String toString() {
return "Land{" +
"kind='" + kind + '\'' +
", status_for_use=" + status_for_use +
", title='" + title + '\'' +
", owner-username=" + ownerusername +
", description='" + description + '\'' +
", value=" + value +
", coordinate=" + coordinate +
", status=" + status +
'}';
}

@Override
public void menu() {

}

@Override
public void buy() {

}

@Override
public void sell() {

}

public Land(){

}
public void UseProperty(String username) {

}


}
4 changes: 4 additions & 0 deletions src/Park.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.example;

public class Park {
}
Loading