Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this would be the Inventory class
- void addItem(Item item){
- if (this.items[item]==null){
- this.items[item]=0;
- }
- this.items[item]=this.items[item]+1;
- }
- // this would be the PlayerInventory class
- void addItem(Item item){
- super.addItem(item);
- if (item.name=="ak47"){
- this.primaryWeapon=item;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement