private ammoslot GetAmmoslot(ammotype ammotype) { foreach (ammoslot slot in ammoSlot) { if (slot.ammotype == ammotype) { return(slot); } } return(null); }
public void increasecurrentammo(ammotype ammotype, int ammoamount) { GetAmmoslot(ammotype).ammoammount += ammoamount; }
// Update is called once per frame public void reducecurrentammo(ammotype ammotype) { GetAmmoslot(ammotype).ammoammount--; }
public int getcurrentammo(ammotype ammotype) { return(GetAmmoslot(ammotype).ammoammount); }
public void increaseammo(ammotype ammotype, int amoamount) { getammoslot(ammotype).ammoamount += amoamount; }
public int decreaseammo(ammotype ammotype) { return(getammoslot(ammotype).ammoamount--); }
public int currentammo(ammotype ammotype) { return(getammoslot(ammotype).ammoamount); }