enhance extensibility
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user