public ActionTypeMenuViewModel(INavigationService navigationService) { RegisterMessages(); this.navigationService = navigationService; windowType = TypeOfWindow.ActionTypes; windowTitle = Helpers.GetDescription(windowType); AddActionTypeCommand = new RelayCommand(NewActionType); EditActionTypeCommand = new RelayCommand(EditActionType); RemoveActionTypeCommand = new RelayCommand(RemoveActionType); using (con) { try { con.Open(); LoadActionTypes(); } catch (Exception ex) { MessageBox.Show("Błąd połączenia z bazą"); } finally { con.Close(); } } selectedActionType = ActionTypes.ElementAt(0); }
public string GetIntent(int turn) { string intent; if (ActionTypes.ElementAt(attackOrder[(turn - 1) % attackOrder.Length]) == CardTypes.Defence) { intent = "Intent: Defend"; } else if (ActionTypes.ElementAt(attackOrder[turn % attackOrder.Length]) == CardTypes.Offence) { intent = "Intent: Attack"; } else { intent = "Intent: Skill"; } return(intent); }