enhance extensibility

This commit is contained in:
Ramtin Jafari
2026-07-07 18:31:36 +03:30
parent 2de96ca23d
commit 8eeeb10b5d
3 changed files with 6 additions and 6 deletions
@@ -36,13 +36,13 @@ public class Costume extends Accessory implements IDefender {
@Override
public void AttachTo(Entity entity) {
entity.Inventory.remove(this);
entity.RemoveFromInventory(this);
entity.Costume = this;
}
@Override
public void DeattachFrom(Entity entity) {
entity.Costume = null;
entity.Inventory.add(this);
entity.AddToInventory(this);
}
}
@@ -36,13 +36,13 @@ public class Shield extends Accessory implements IDefender {
@Override
public void AttachTo(Entity entity) {
entity.Inventory.remove(this);
entity.RemoveFromInventory(this);
entity.Shield = this;
}
@Override
public void DeattachFrom(Entity entity) {
entity.Shield = null;
entity.Inventory.add(this);
entity.AddToInventory(this);
}
}
@@ -16,13 +16,13 @@ public class Weapon extends Accessory {
@Override
public void AttachTo(Entity entity) {
entity.Inventory.remove(this);
entity.RemoveFromInventory(this);
entity.Weapon = this;
}
@Override
public void DeattachFrom(Entity entity) {
entity.Weapon = null;
entity.Inventory.add(this);
entity.AddToInventory(this);
}
}