cgorrillaha

Person

Nov 30th, 2021
619
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package fullOutput;
  2.  
  3. public class Person {
  4.     private int ammo, personCount;
  5.    
  6.     public Person(int ammo, int personCount){
  7.         this.ammo=ammo;
  8.         this.personCount=personCount;
  9.     }
  10.  
  11.     public void killPerson(){
  12.         personCount--;
  13.         setAmmo(150);
  14.     }
  15.    
  16.     public void useAmmo(){
  17.         ammo--;
  18.     }
  19.    
  20.     public int getAmmo() {
  21.         return ammo;
  22.     }
  23.  
  24.     public void setAmmo(int ammo) {
  25.         this.ammo = ammo;
  26.     }
  27.  
  28.     public int getPersonCount() {
  29.         return personCount;
  30.     }
  31.  
  32.     public void setPersonCount(int personCount) {
  33.         this.personCount = personCount;
  34.     }
  35.  
  36.     @Override
  37.     public String toString() {
  38.         return "Person [ammo=" + ammo + ", personCount=" + personCount + "]";
  39.     }
  40. }
  41.  
RAW Paste Data