Advertisement
Guest User

Players.class

a guest
Feb 28th, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. package game01;
  8.  
  9. /**
  10.  *
  11.  * @author Alex
  12.  */
  13. public class Players {
  14.     private String name;
  15.     private int money;
  16.     private double posX;
  17.     private double posY;
  18.     private double posZ;
  19.    
  20.     public void setName(String n) {
  21.         name = n;
  22.     }
  23.     public String getName() {
  24.         return name;
  25.     }
  26.     public void setMoney(int m) {
  27.         money = m;
  28.     }
  29.     public int getMoney() {
  30.         return money;
  31.     }
  32.     public void setPosX(double x) {
  33.         posX = x;
  34.     }
  35.     public double getPosX() {
  36.         return posX;
  37.     }
  38.     public void setPosY(double y) {
  39.         posY = y;
  40.     }
  41.     public double getPosY() {
  42.         return posY;
  43.     }
  44.     public void setPosZ(double z) {
  45.         posZ = z;
  46.     }
  47.     public double getPosZ() {
  48.         return posZ;
  49.     }
  50.     public void playerInfo() {
  51.         System.out.printf("Player name: %s ", name);
  52.         System.out.printf("Player money: %s ", money);
  53.         System.out.printf("Player posX: %,2f ", posX);
  54.         System.out.printf("Player posY: %,2f ", posY);
  55.         System.out.printf("Player posZ: %,2f ", posZ);
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement