예제 #1
0
        public void Run()
        {
            var combatLogger = new CombatLogger();
            var eventLogger  = new EventLogger();

            combatLogger.SetSuccessor(eventLogger);

            var warriorGosho = new Warrior("gosho", 10, combatLogger);
            var warriorPesho = new Warrior("pesho", 100, combatLogger);

            var group = new Group();

            group.AddMember(warriorGosho);
            group.AddMember(warriorPesho);

            var dragon = new Dragon("SnowWhite", 200, 25, combatLogger);

            var executor = new CommandExecutor();

            var groupTarget = new GroupTargetCommand(group, dragon);
            var groupAttack = new GroupAttackCommand(group);

            executor.ExecuteCommand(groupTarget);
            executor.ExecuteCommand(groupAttack);
        }
예제 #2
0
    static void Main(string[] args)
    {
        CombatLogger combatLogger = new CombatLogger();
        EventLogger  eventLogger  = new EventLogger();
        TargetLogger targetLogger = new TargetLogger();

        combatLogger.SetSuccessor(eventLogger);
        eventLogger.SetSuccessor(targetLogger);

        IAttacker pesho  = new Warrior("Pesho", 10, combatLogger);
        IAttacker stamat = new Warrior("Stamat", 20, combatLogger);

        IAttackGroup attackGroup = new AttackGroup();

        attackGroup.AddMember(pesho);
        attackGroup.AddMember(stamat);

        ITarget target = new Dragon("Drago", 30, 200, combatLogger);

        ((ISubject)target).Register((IObserver)pesho);
        ((ISubject)target).Register((IObserver)stamat);

        IExecutor executor           = new CommandExecutor();
        ICommand  groupTargetCommand = new GroupTargetCommand(attackGroup, target);
        ICommand  groupAttackCommand = new GroupAttackCommand(attackGroup);

        executor.ExecuteCommand(groupAttackCommand);
        executor.ExecuteCommand(groupTargetCommand);
        executor.ExecuteCommand(groupAttackCommand);
        executor.ExecuteCommand(groupAttackCommand);
    }
    static void Main(string[] args)
    {
        Logger combatLog = new CombatLogger();
        Logger eventLog  = new EventLogger();

        combatLog.SetSuccessor(eventLog);

        AbstractHero      warrior  = new Warrior("1", 10, combatLog);
        AbstractHero      warrior2 = new Warrior("2", 20, combatLog);
        IObservableTarget dragon   = new Dragon("3", 30, 25, combatLog);

        IAttackGroup group = new Group();

        group.AddMember(warrior);
        group.AddMember(warrior2);
        dragon.Register(warrior);
        dragon.Register(warrior2);

        IExecutor executor = new CommandExecutor();

        ICommand groupTarget = new GroupTargetCommand(group, dragon);
        ICommand groupAttack = new GroupAttackCommand(group);

        executor.ExecuteCommand(groupTarget);
        executor.ExecuteCommand(groupAttack);

        Console.WriteLine(warrior.Rewards);
        Console.WriteLine(warrior2.Rewards);
    }
예제 #4
0
 void Awake()
 {
     GameLogic.PlayerList.Add(this);
     Animator = new AnimationHandler(this);
     this.ID  = GameLogic.GetLastID();
     //this.Spellbook = Skills.GetAllActiveSkillsByClass(this, this.@class);
     CombatLogger = new CombatLogger(this);
 }
예제 #5
0
        private CombatLogger CreateCombatLogger()
        {
            var logger = _combatLoggerFactory(this);

            logger.Expired = () =>
            {
                _combatLogger = null;
            };
            return(logger);
        }
예제 #6
0
 public void GetWorldControllers()
 {
     boardController      = GetComponent <BoardController>();
     playerController     = GetComponent <PlayerController>();
     npcController        = GetComponent <NpcController>();
     sessionLogger        = GetComponent <SessionLogger>();
     combatLogger         = GetComponent <CombatLogger>();
     dialogueManager      = GetComponent <DialogueManager>();
     objectPoolController = GetComponent <ObjectPoolController>();
     translator           = GetComponent <Translator>();
     hudCanvas            = GameObject.Find("HUDCanvas");
 }
        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);
        }
예제 #8
0
    public static void Main()
    {
        Logger combatLogger = new CombatLogger();
        Logger eventLogger  = new EventLogger();

        combatLogger.SetSuccessor(eventLogger);

        Warrior warrior = new Warrior("Gosho", 10, combatLogger);
        Dragon  dragon  = new Dragon("Dragon", 100, 25, combatLogger);

        IExecutor executor = new CommandExecutor();
        ICommand  command  = new TargetCommand(warrior, dragon);
        ICommand  attack   = new AttackCommand(warrior);
    }
예제 #9
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
     loggerPanel.SetActive(false);
     textWait  = new WaitForSeconds(textDelay);
     textWait2 = new WaitForSeconds(textDelay2);
 }
예제 #10
0
        public static void Main()
        {
            Logger combatLog = new CombatLogger();
            Logger eventLog  = new EventLogger();

            combatLog.SetSuccessor(eventLog);

            Warrior warrior = new Warrior("Mountain", 10, combatLog);
            Dragon  dragon  = new Dragon("Dracarys", 100, 25, combatLog);

            IExecutor executor = new CommandExecutor();

            ICommand targetCommand = new TargetCommand(warrior, dragon);

            targetCommand.Execute();
        }
예제 #11
0
        public void Run()
        {
            var combatLogger = new CombatLogger();
            var eventLogger  = new EventLogger();

            combatLogger.SetSuccessor(eventLogger);

            var warrior = new Warrior("gosho", 10, combatLogger);
            var dragon  = new Dragon("pesho", 100, 25, combatLogger);

            var executor = new CommandExecutor();
            var command  = new TargetCommand(warrior, dragon);
            var attack   = new AttackCommand(warrior);

            executor.ExecuteCommand(command);
            executor.ExecuteCommand(attack);
        }
예제 #12
0
    public static void Main(string[] args)
    {
        Logger combatLog = new CombatLogger();
        Logger eventLog  = new EventLogger();

        combatLog.SetSuccessor(eventLog);

        IAttackGroup group = new Group();

        group.AddMember(new Warrior("Quannarin", 10, combatLog));
        group.AddMember(new Warrior("Pancho", 15, combatLog));

        ITarget dragon = new Dragon("Mincho", 200, 25);

        IExecutor executor    = new CommandExecutor();
        ICommand  groupTarget = new GroupTargetCommand(group, dragon);
        ICommand  attack      = new GroupAttackCommand(group);
    }
예제 #13
0
    private void Awake()
    {
        var gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();

        Player = new Player(this, gm.PlayerInfo);

        RaidItemLevel = Player.ItemLevel;
        Raid          = new Raid(this, Player, RaidSize);

        Boss = new TestBoss(this);

        UFManager.PopulateUnitFrames(this);
        CombatLogger = GetComponent <CombatLogger>();
        DamageMeter  = GetComponent <DamageMeter>();

        CombatLogger.enabled = false;
        DamageMeter.enabled  = false;
    }
예제 #14
0
        static void Main(string[] args)
        {
            Logger combatLog = new CombatLogger();
            Logger eventLog  = new EventLogger();

            combatLog.SetSuccessor(eventLog);

            IAttackGroup group = new Group();

            group.AddMember(new Warrior("Torsten", 10, combatLog));
            group.AddMember(new Warrior("Rolo", 15, combatLog));

            ITarget dragon = new Dragon("Transylvanian White", 200, 25, combatLog);

            IExecutor executor = new CommandExecutor();

            ICommand groupTarget = new GroupTargetCommand(group, dragon);
            ICommand groupAttack = new GroupAttackCommand(group);
        }
예제 #15
0
    public static void Main()
    {
        Logger combatLogger = new CombatLogger();
        Logger eventLogger  = new EventLogger();

        combatLogger.SetSuccessor(eventLogger);

        IAttackGroup group = new Group();

        group.AddMember(new Warrior("gosho", 10, combatLogger));
        group.AddMember(new Warrior("Rolo", 15, combatLogger));

        var dragon = new Dragon("Peter", 200, 25, combatLogger);

        IExecutor executor = new CommandExecutor();

        ICommand groupTarget = new GroupTargetCommand(group, dragon);
        ICommand groupAttack = new GroupAttackCommand(group);
    }
예제 #16
0
    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);
    }
예제 #17
0
    public static void Main()
    {
        Logger combatLog = new CombatLogger();
        Logger eventLog  = new EventLogger();

        combatLog.SetSuccessor(eventLog);

        IAttackGroup attackGroup = new Group();

        attackGroup.AddMember(new Warrior("Pesho", 10, combatLog));
        attackGroup.AddMember(new Warrior("Gosho", 20, combatLog));

        var dragon = new Dragon("Blue-Eyed White Dragon", 100, 25, combatLog);

        IExecutor executor = new CommandExecutor();

        ICommand groupTarget = new GroupTargetCommand(attackGroup, dragon);

        groupTarget.Execute();

        ICommand groupAttack = new GroupAttackCommand(attackGroup);

        groupAttack.Execute();
    }