public GameMainPage(Player currentPlayer, ServerItemController serverItemController, BattleEffectController battleEffectCntrl)         // serverItemController added
 {
     InitializeComponent();
     this.currentPlayer        = currentPlayer;
     this.serverItemController = serverItemController;
     this.battleEffectCntrl    = battleEffectCntrl;
 }
Example #2
0
 public GameStartPage(Player currentPlayer, ServerItemController serverItemController, BattleEffectController battleEffectCntrl) // setting deleted
 {
     InitializeComponent();
     this.characterController  = new CharacterController();
     this.currentPlayer        = currentPlayer;
     this.serverItemController = serverItemController;
     this.battleEffects        = battleEffectCntrl;
     BindingContext            = this;
 }
    public void ExecuteBattleEffect(BattleSimulationUnit initiator, BattleSimulationUnit activator, BattleSimulationTarget target, BattleEffect battleEffect, BattleActionContext actionContext)
    {
        Diagnostics.Assert(this.battleEffectsContexts != null, "this.battleEffectsContexts != null");
        BattleEffectController battleEffectController;

        if (this.battleEffectsContexts.ContainsKey(target))
        {
            battleEffectController = this.battleEffectsContexts[target];
        }
        else
        {
            battleEffectController = new BattleEffectController(target, this.Simulation);
            this.battleEffectsContexts.Add(target, battleEffectController);
        }
        Diagnostics.Assert(battleEffectController != null);
        battleEffectController.Execute(battleEffect, initiator, activator, this, actionContext);
    }
Example #4
0
 public BattlePage(Player currentPlayer, ServerItemController serverItemController, BattleEffectController battleEffect, bool auto)
 {
     InitializeComponent();
     this.serverItemController = serverItemController;
     DependencyService.Get <IAudioPlayerService>().Pause();
     DependencyService.Get <IAudioPlayerService>().Play("prelude");
     this.currentPlayer = currentPlayer;
     BindingContext     = BattleEngineView = new BattleViewModel(currentPlayer, serverItemController, auto);
     counter            = 0;
     rand = new Random();
     this.characterController = new CharacterController();
     BattleEffects            = battleEffect;
     if (serverItemController.currentSetting.BattleEvents == true)
     {
         var randomEvent = BattleEffects.Effects[rand.Next(0, BattleEffects.Effects.Count)].UseEffect(BattleEngineView.CharacterList, BattleEngineView.monster_dictionary);
         DisplayAlert("Battle Event!", randomEvent, "OK");
     }
     if (auto)
     {
         runTilEnd();
     }
 }