예제 #1
0
        public void WcfAddFighter(Fighter.TypeFighter typeFighter, Cell addedCell)
        {
            addedCell = SearchNeedCell(addedCell);
            CellViewModel cellVM = SearchCellVMtoCell(addedCell);

            if (Fighter.CanAddFighter(typeFighter, _fieldViewModel.Game.WhoTurn))
            {
                switch (typeFighter)
                {
                case Fighter.TypeFighter.WizardFighter:
                    cellVM.Cell.Fighter = new WizardFighter(_fieldViewModel.Field.Game.WhoTurn.Orientation, addedCell, typeFighter);
                    break;

                case Fighter.TypeFighter.ArcherFighter:
                    cellVM.Cell.Fighter = new ArcherFighter(_fieldViewModel.Field.Game.WhoTurn.Orientation, addedCell, typeFighter);
                    break;

                case Fighter.TypeFighter.BarbarianFighter:
                    cellVM.Cell.Fighter = new BarbarianFighter(_fieldViewModel.Field.Game.WhoTurn.Orientation, addedCell, typeFighter);
                    break;

                default:
                    break;
                }
                _fieldViewModel.BattleFieldViewModel.RefreshPanelEnergyAndWhoTurn();
                FieldViewModel.ClearAllCellsFromSelection();
                cellVM.Fighter = null; //refresh
            }
            else
            if (FieldViewModel.Game.WhoTurn._user.Equals(_fieldViewModel.BattleFieldViewModel.You))
            {
                new MsgBoxGame("Not enough energy").ShowDialog();
            }
        }
예제 #2
0
 public void AddFighter(Fighter.TypeFighter typeFighter, Cell addedCell)
 {
     _battleFieldViewModel.FieldViewModel.Cells[0].WcfAddFighter(typeFighter, addedCell);
 }
예제 #3
0
파일: GameProxy.cs 프로젝트: Tatko95/Hero
 public void AddFighter(Game game, Fighter.TypeFighter typeFighter, Cell addedCell)
 {
     _chanel.AddFighter(game, typeFighter, addedCell);
 }
예제 #4
0
 private void SetHelpersMethod(Fighter.TypeFighter typeFighter)
 {
     FieldViewModel.MarkCellsForAddNewFigure();
     FieldViewModel.HelperIsAddNewFigure.IsAddedCommand = true;
     FieldViewModel.HelperIsAddNewFigure.TypeFighter    = typeFighter;
 }
예제 #5
0
 public void AddFighter(Game game, Fighter.TypeFighter typeFighter, Cell addedCell)
 {
     CachData.Games[game].CallBack1.AddFighter(typeFighter, addedCell);
     CachData.Games[game].CallBack2.AddFighter(typeFighter, addedCell);
 }