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);
        }
Esempio n. 2
0
        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);
        }