mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 03:01:12 +00:00
added bridge sample
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.iluwatar;
|
||||
|
||||
public class FlyingMagicWeapon extends MagicWeapon {
|
||||
|
||||
public FlyingMagicWeapon(FlyingMagicWeaponImp imp) {
|
||||
super(imp);
|
||||
}
|
||||
|
||||
public FlyingMagicWeaponImp getImp() {
|
||||
return (FlyingMagicWeaponImp) imp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wield() {
|
||||
getImp().wieldImp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swing() {
|
||||
getImp().swingImp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unwield() {
|
||||
getImp().unwieldImp();
|
||||
}
|
||||
|
||||
public void fly() {
|
||||
getImp().flyImp();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user