public static void Main(string[] args) { AbstractLogger combatLogger = new CombatLogger(); AbstractLogger eventLoggger = new EventLogger(); combatLogger.SetSuccessor(eventLoggger); IAttacker warrior = new Warrior("dani", 10, combatLogger); IAttacker warrior2 = new Warrior("dani2", 10, combatLogger); IAttacker warrior3 = new Warrior("dani3", 10, combatLogger); ISubjectTargetable target = new Dragon("federica", 20, 1000, combatLogger); IExecutor executor = new CommandExecutor(); IAttackGroup group = new Group(); group.AddMember(warrior); group.AddMember(warrior2); group.AddMember(warrior3); ICommand setTargetOfAttackGroup = new SetTargetOfAttackGroup(group, target); ICommand attackCommand = new AttackGroupAttackCommand(group); executor.ExecuteCommand(setTargetOfAttackGroup); executor.ExecuteCommand(attackCommand); executor.ExecuteCommand(attackCommand); Console.WriteLine("Warrior fortune : " + warrior.Fortune); Console.WriteLine("Warrior fortune2 : " + warrior2.Fortune); Console.WriteLine("Warrior fortune3 : " + warrior3.Fortune); }
public static void Main() { Logger combatLog = new CombatLogger(); Logger eventlog = new EventLogger(); combatLog.SetSuccessor(eventlog); IAttacker warrior = new Warrior("Gencho", 10, combatLog); ITarget dragon = new Dragon("Lamia", 100, 25, combatLog); IExecutor executor = new CommandExecutor(); ICommand command = new TargetCommand(warrior, dragon); ICommand attack = new AttackCommand(warrior); }
public static void Main(string[] args) { Logger combatLog = new CombatLogger(); Logger eventLog = new EventLogger(); combatLog.SetSuccessor(eventLog); var warrior = new Warrior("gosho", 10, combatLog); var dragon = new Dragon("Peter", 100, 25, combatLog); IExecutor executor = new CommandExecutor(); ICommand command = new TargetCommand(warrior, dragon); ICommand attack = new AttackCommand(warrior); }
public static void Main() { Logger combatLog = new CombatLogger(); Logger eventlog = new EventLogger(); combatLog.SetSuccessor(eventlog); IAttackGroup attackGroup = new Group(); attackGroup.AddMember(new Warrior("Gencho", 15, combatLog)); attackGroup.AddMember(new Warrior("Pesho", 25, combatLog)); ITarget dragon = new Dragon("Lamia", 200, 25, combatLog); IExecutor executor = new CommandExecutor(); ICommand groupTarget = new GroupTargetCommand(attackGroup, dragon); ICommand groupAttack = new GroupAttackCommand(attackGroup); }
public static void Main(string[] args) { var combatLogger = new CombatLogger(); var eventLogger = new EventLogger(); combatLogger.SetSuccsessor(eventLogger); var group = new Group(); group.AddMember(new Warrior("Torsten", 10, combatLogger)); group.AddMember(new Warrior("Rolo", 15, combatLogger)); var dragon = new Dragon("Transylvanian White", 200, 25, combatLogger); var executor = new CommandExecutor(); var groupTarget = new GroupTargetCommand(group, dragon); var groupAttack = new GroupAttackCommand(group); }
public static void Main() { Logger combatLogger = new CombatLogger(); Logger eventLogger = new EventLogger(); combatLogger.SetSuccessor(eventLogger); Warrior firstWarrior = new Warrior("Torsten", 10, combatLogger); Warrior secondWarrior = new Warrior("Rolo", 20, combatLogger); Dragon dragon = new Dragon("Transylvanian White", 200, 25, combatLogger); IAttackGroup group = new Group(); group.AddMember(firstWarrior); group.AddMember(secondWarrior); IExecutor executor = new CommandExecutor(); ICommand groupTarget = new GroupTargetCommand(group, dragon); ICommand groupAttack = new GroupAttackCommand(group); }
public static void Main(string[] args) { IHandler combatLogger = new CombatLogger(); IHandler eventLogger = new CombatLogger(); combatLogger.SetSuccessor(eventLogger); IAttackGroup attackGroup = new Group(); IAttacker warrior = new Warrior("gosho", 10, combatLogger); IAttacker attacker = new Warrior("atanas", 100, combatLogger); attackGroup.AddMember(warrior); attackGroup.AddMember(attacker); ITarget dragon = new Dragon("Peter", 100, 25, combatLogger); IExecutor executor = new CommandExecutor(); ICommand command = new TargetCommand(warrior, dragon); ICommand attack = new AttackCommand(warrior); ICommand groupTargetCommand = new GroupTargetCommand(attackGroup, dragon); ICommand groupAttackCommand = new GroupAttackCommand(attackGroup); }