* Using static object to reduce memory foot prints

* Updating README along with name of static fields

* Updating code as per review comments

* Updating code as per review comments

* Updating doc as per new code
This commit is contained in:
Hemant Bothra
2019-10-30 11:57:24 +05:30
committed by Ilkka Seppälä
parent a9dfd7e809
commit cdb80b8ddd
3 changed files with 27 additions and 5 deletions

View File

@ -42,13 +42,13 @@ public interface Blacksmith {
public class ElfBlacksmith implements Blacksmith {
public Weapon manufactureWeapon(WeaponType weaponType) {
return new ElfWeapon(weaponType);
return ELFARSENAL.get(weaponType);
}
}
public class OrcBlacksmith implements Blacksmith {
public Weapon manufactureWeapon(WeaponType weaponType) {
return new OrcWeapon(weaponType);
return ORCARSENAL.get(weaponType);
}
}
```