Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

INTERFACES

(Abstract)
ENEMY

GHOST SKELETON ZOMBIE

<INTERFACE>
IDamagable

SWORD

The sword doesn’t have to check using if else or case statement if it has
damaged a Ghost, Skeleton or Zombie. The sword attack Class uses a
reference hit for IDamagable to discover the Enemy type that’s received
damage from the sword by using the IDamagable interface.

You might also like