cgorrillaha

Untitled

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