added mediator sample

This commit is contained in:
Ilkka Seppala
2014-08-21 20:06:49 +03:00
parent 46408565cd
commit 82f5f88964
12 changed files with 217 additions and 0 deletions
@@ -0,0 +1,23 @@
package com.iluwatar;
public class App
{
public static void main( String[] args )
{
Party party = new PartyImpl();
Hobbit hobbit = new Hobbit();
Wizard wizard = new Wizard();
Rogue rogue = new Rogue();
Hunter hunter = new Hunter();
party.addMember(hobbit);
party.addMember(wizard);
party.addMember(rogue);
party.addMember(hunter);
hobbit.act(Action.ENEMY);
wizard.act(Action.TALE);
rogue.act(Action.GOLD);
hunter.act(Action.HUNT);
}
}