Last active
January 1, 2019 15:24
-
-
Save pcrunn/b4b0e9df9d5604c2fbf6fb5ab6d069bd to your computer and use it in GitHub Desktop.
Profiles System
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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