Skip to content

Instantly share code, notes, and snippets.

@pcrunn
Last active January 1, 2019 15:24
Show Gist options
  • Save pcrunn/b4b0e9df9d5604c2fbf6fb5ab6d069bd to your computer and use it in GitHub Desktop.
Save pcrunn/b4b0e9df9d5604c2fbf6fb5ab6d069bd to your computer and use it in GitHub Desktop.
Profiles System
@Data
public class Profile {
public static List<Profile> profiles = new ArrayList<>();
Player player;
public Profile(Player player){
this.player = player;
this.profiles.add(this);
}
public static Profile getProfileByPlayer(Player player){
for(Profile profile : profiles){
if(profile.getPlayer()==player){
return profile;
}
}
return new Profile(player);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment