Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DataTypes;
- public class Player {
- final byte id;
- final String clan;
- final String name;
- final String hash;
- final String ip;
- public byte getId() {
- return this.id;
- }
- public String getClan() {
- return this.clan;
- }
- public String getName() {
- return this.name;
- }
- public String getHash() {
- return this.hash;
- }
- public String getIp() {
- return this.ip;
- }
- public String getClanAndName() {
- return (this.getClan() + " " + this.getName());
- }
- public Player (byte id, String clantag, String name, String hash, String ip) {
- this.id = id;
- this.clan = (clantag.length() <= 1) ? "" : clantag;
- this.name = (name.length() <= 1) ? "ERROR NO NAME" : name;
- this.hash = (hash.length() <= 1) ? "NO HASH" : hash;
- this.ip = (ip.length() <= 1) ? "NO IP" : ip;
- }
- public Player () {
- this.id = 0;
- this.clan = "ERROR";
- this.name = "ERROR";
- this.hash = "ERROR";
- this.ip = "ERROR";
- }
- public String vomit(){
- return ("ID: " + String.format("%#04x", getId()) +
- "\tClan: " + getClan() +
- "\tPlayername: " + getName() +
- "\t\tHash: " + getHash() +
- " \tIP: " + getIp());
- }
- public String toString() {
- return(getClanAndName() + " \t(Hash: " + getHash() + " IP: " + getIp() + ")");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement