Beispiel #1
0
        private void EnemyAct()
        {
            var AttackingCharacter = CombatController.ActiveEnemies[0];
            var DefendingCharacter = CombatController.ActiveAllies[0];

            EventDispatcher.Attack(AttackingCharacter, DefendingCharacter);

            TurnEventDispatcher.DispatchEndTurn();
        }
        public void OnAttackClick()
        {
            if (!HasCurrentTurn)
            {
                return;
            }
            CommandDispatcher.Attack(SelectionSystem.GetSelectedAlly(), SelectionSystem.GetSelectedEnemy());

            TurnDispatcher.DispatchEndTurn();
            HasCurrentTurn = false;
        }
        private void Start()
        {
            NotificationSystem.RegisterListener(Visit);
            CommandDispatcher = new CombatEventDispatcher(NotificationSystem);
            TurnDispatcher    = new TurnEventDispatcher(NotificationSystem);
            SelectionSystem   = new SelectionSystem(CombatController);
            PlayerTurnHandler = new PlayerTurnHandler(OnTurnStart);
            TurnSystem.SetPlayerTurnHandler(PlayerTurnHandler);

            PlayerInfo = PlayerInfo.CreateFromPersistence();

            PlayerCharacter = PlayerInfo.PlayerCharacter.DecorateWithEquipmentDecorator();

            CombatController.ActiveAllies = new List <ICharacter> {
                PlayerCharacter
            };
            TurnDispatcher.DispatchEndTurn();
        }
 public void OnTurnStart()
 {
     TurnEventDispatcher.DispatchEndTurn();
 }