mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 18:59:21 +00:00
Added comments and class diagram.
This commit is contained in:
@@ -4,6 +4,11 @@ import com.iluwatar.property.Color;
|
||||
import com.iluwatar.property.Movement;
|
||||
import com.iluwatar.property.Size;
|
||||
|
||||
/**
|
||||
*
|
||||
* Base class for concrete creatures.
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractCreature implements Creature {
|
||||
|
||||
private String name;
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.iluwatar.property.Color;
|
||||
import com.iluwatar.property.Movement;
|
||||
import com.iluwatar.property.Size;
|
||||
|
||||
/**
|
||||
*
|
||||
* Creature interface.
|
||||
*
|
||||
*/
|
||||
public interface Creature {
|
||||
|
||||
String getName();
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.iluwatar.property.Color;
|
||||
import com.iluwatar.property.Movement;
|
||||
import com.iluwatar.property.Size;
|
||||
|
||||
/**
|
||||
*
|
||||
* Dragon creature.
|
||||
*
|
||||
*/
|
||||
public class Dragon extends AbstractCreature {
|
||||
|
||||
public Dragon() {
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.iluwatar.property.Color;
|
||||
import com.iluwatar.property.Movement;
|
||||
import com.iluwatar.property.Size;
|
||||
|
||||
/**
|
||||
*
|
||||
* Goblin creature.
|
||||
*
|
||||
*/
|
||||
public class Goblin extends AbstractCreature {
|
||||
|
||||
public Goblin() {
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.iluwatar.property.Color;
|
||||
import com.iluwatar.property.Movement;
|
||||
import com.iluwatar.property.Size;
|
||||
|
||||
/**
|
||||
*
|
||||
* KillerBee creature.
|
||||
*
|
||||
*/
|
||||
public class KillerBee extends AbstractCreature {
|
||||
|
||||
public KillerBee() {
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.iluwatar.property.Color;
|
||||
import com.iluwatar.property.Movement;
|
||||
import com.iluwatar.property.Size;
|
||||
|
||||
/**
|
||||
*
|
||||
* Octopus creature.
|
||||
*
|
||||
*/
|
||||
public class Octopus extends AbstractCreature {
|
||||
|
||||
public Octopus() {
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.iluwatar.property.Color;
|
||||
import com.iluwatar.property.Movement;
|
||||
import com.iluwatar.property.Size;
|
||||
|
||||
/**
|
||||
*
|
||||
* Shark creature.
|
||||
*
|
||||
*/
|
||||
public class Shark extends AbstractCreature {
|
||||
|
||||
public Shark() {
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.iluwatar.property.Color;
|
||||
import com.iluwatar.property.Movement;
|
||||
import com.iluwatar.property.Size;
|
||||
|
||||
/**
|
||||
*
|
||||
* Troll creature.
|
||||
*
|
||||
*/
|
||||
public class Troll extends AbstractCreature {
|
||||
|
||||
public Troll() {
|
||||
|
||||
Reference in New Issue
Block a user