You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
141 lines
5.7 KiB
141 lines
5.7 KiB
package org.poopki.duckdns.user_db.Array; |
|
|
|
import java.util.*; |
|
|
|
public class Group { |
|
private String m_Name; |
|
private List<UUID> m_MemberList = new ArrayList<>(); |
|
public List<String> TechList = Arrays.asList("agriculture","pottery","animal_husbandry","archery","mining","sailing","calendar","writing","trapping","wheel","masonry","bronze","optics","horseback","mathematics","construction","philosophy","drama","currency","engineering","iron_working","theology","civil_service","guilds","metal_casting","compass","education","chivalry","machinery","physics","steel","astronomy","acoustics","banking","printing_press","gunpowder","navigation","architecture","economics","metallurgy","chemistry","archaeology","scientific_theory","industrialization","rifling","military_science","fertilizer","biology","electricity","steam_power","dynamite","refrigeration","radio","flight","railroad","plastics","electronics","ballistics","combustion","penicillin","atomic_theory","radar","combined_arms","ecology","nuclear_fission","rocketry","computers","telecommunications","mobile_tactics","advanced_ballistics","satellites","robotics","lasers","the_internet","globalization","particle_physics","nuclear_fusion","nanotechnology","stealth"); |
|
public Map<String, Integer> m_TechStat = new HashMap<String, Integer>(); |
|
UUID ZERO_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000"); |
|
int MAX_FARM_NUM = 10; |
|
|
|
public Group(String Name, List<UUID> uuid_list){ |
|
int index = 0; |
|
for(UUID key: uuid_list){ |
|
m_MemberList.add(index,key); |
|
index++; |
|
} |
|
InitTechTree(); |
|
m_Name = Name; |
|
} |
|
|
|
public void SignUp(UUID uuid){ |
|
m_MemberList.add((UUID)uuid); |
|
} |
|
|
|
public void Expulsion(UUID uuid){ |
|
m_MemberList.remove(uuid); |
|
} |
|
|
|
public boolean isMember(UUID uuid){ |
|
return m_MemberList.contains(uuid); |
|
} |
|
public int getMemMaxNUM(){ |
|
return MAX_FARM_NUM; |
|
} |
|
public List<UUID> getGroupMembers(){ return m_MemberList;} |
|
public int getMemNUM(){ |
|
int num = m_MemberList.size(); |
|
return num; |
|
} |
|
|
|
public String getGroupName(){ return m_Name; } |
|
public int isEmpty(){return m_MemberList.size();} |
|
public boolean isOwner(UUID uuid){ |
|
if(m_MemberList.get(0).equals(uuid)){ |
|
return true; |
|
}else{ |
|
return false; |
|
} |
|
} |
|
|
|
public void InitTechTree(){ |
|
m_TechStat.put("agriculture",0); |
|
m_TechStat.put("pottery",0); |
|
m_TechStat.put("animal_husbandry",0); |
|
m_TechStat.put("archery",0); |
|
m_TechStat.put("mining",0); |
|
m_TechStat.put("sailing",0); |
|
m_TechStat.put("calendar",0); |
|
m_TechStat.put("writing",0); |
|
m_TechStat.put("trapping",0); |
|
m_TechStat.put("wheel",0); |
|
m_TechStat.put("masonry",0); |
|
m_TechStat.put("bronze",0); |
|
m_TechStat.put("optics",0); |
|
m_TechStat.put("horseback",0); |
|
m_TechStat.put("mathematics",0); |
|
m_TechStat.put("construction",0); |
|
m_TechStat.put("philosophy",0); |
|
m_TechStat.put("drama",0); |
|
m_TechStat.put("currency",0); |
|
m_TechStat.put("engineering",0); |
|
m_TechStat.put("iron_working",0); |
|
m_TechStat.put("theology",0); |
|
m_TechStat.put("civil_service",0); |
|
m_TechStat.put("guilds",0); |
|
m_TechStat.put("metal_casting",0); |
|
m_TechStat.put("compass",0); |
|
m_TechStat.put("education",0); |
|
m_TechStat.put("chivalry",0); |
|
m_TechStat.put("machinery",0); |
|
m_TechStat.put("physics",0); |
|
m_TechStat.put("steel",0); |
|
m_TechStat.put("astronomy",0); |
|
m_TechStat.put("acoustics",0); |
|
m_TechStat.put("banking",0); |
|
m_TechStat.put("printing_press",0); |
|
m_TechStat.put("gunpowder",0); |
|
m_TechStat.put("navigation",0); |
|
m_TechStat.put("architecture",0); |
|
m_TechStat.put("economics",0); |
|
m_TechStat.put("metallurgy",0); |
|
m_TechStat.put("chemistry",0); |
|
m_TechStat.put("archaeology",0); |
|
m_TechStat.put("scientific_theory",0); |
|
m_TechStat.put("industrialization",0); |
|
m_TechStat.put("rifling",0); |
|
m_TechStat.put("military_science",0); |
|
m_TechStat.put("fertilizer",0); |
|
m_TechStat.put("biology",0); |
|
m_TechStat.put("electricity",0); |
|
m_TechStat.put("steam_power",0); |
|
m_TechStat.put("dynamite",0); |
|
m_TechStat.put("refrigeration",0); |
|
m_TechStat.put("radio",0); |
|
m_TechStat.put("flight",0); |
|
m_TechStat.put("railroad",0); |
|
m_TechStat.put("plastics",0); |
|
m_TechStat.put("electronics",0); |
|
m_TechStat.put("ballistics",0); |
|
m_TechStat.put("combustion",0); |
|
m_TechStat.put("penicillin",0); |
|
m_TechStat.put("atomic_theory",0); |
|
m_TechStat.put("radar",0); |
|
m_TechStat.put("combined_arms",0); |
|
m_TechStat.put("ecology",0); |
|
m_TechStat.put("nuclear_fission",0); |
|
m_TechStat.put("rocketry",0); |
|
m_TechStat.put("computers",0); |
|
m_TechStat.put("telecommunications",0); |
|
m_TechStat.put("mobile_tactics",0); |
|
m_TechStat.put("advanced_ballistics",0); |
|
m_TechStat.put("satellites",0); |
|
m_TechStat.put("robotics",0); |
|
m_TechStat.put("lasers",0); |
|
m_TechStat.put("the_internet",0); |
|
m_TechStat.put("globalization",0); |
|
m_TechStat.put("particle_physics",0); |
|
m_TechStat.put("nuclear_fusion",0); |
|
m_TechStat.put("nanotechnology",0); |
|
m_TechStat.put("stealth",0); |
|
} |
|
public void SetTechTree(String TechName, Integer set){ |
|
m_TechStat.replace(TechName,set); |
|
} |
|
|
|
public int GetTechTree(String TechName){ |
|
return m_TechStat.get(TechName); |
|
} |
|
}
|
|
|