mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-03 05:20:09 +00:00
Improved comments for strategy pattern sample.
This commit is contained in:
1 parent
27a27594f4
commit
991653062d
4 files changed
+16
-1
No files matched your search
@@ -2,7 +2,7 @@ package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Strategy (DragonSlayingStrategy) encapsulates the algorithm to use. The
|
||||
* Strategy (DragonSlayingStrategy) encapsulates an algorithm. The containing
|
||||
* object (DragonSlayer) can alter its behavior by changing its strategy.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Melee strategy.
|
||||
*
|
||||
*/
|
||||
public class MeleeStrategy implements DragonSlayingStrategy {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Projectile strategy.
|
||||
*
|
||||
*/
|
||||
public class ProjectileStrategy implements DragonSlayingStrategy {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Spell strategy.
|
||||
*
|
||||
*/
|
||||
public class SpellStrategy implements DragonSlayingStrategy {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user