* 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 authored and Ilkka Seppälä committed 2019-10-30 08:27:24 +02:00
1 parent a9dfd7e809
commit cdb80b8ddd
3 files changed
+27 -5

No files matched your search

+2 -2
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);
}
}
```