public ConditionSettings(ConnectionXML conn) { InitializeComponent(); this.connection = conn; //this.connection.Type = ConnectionTypes.eCondition; if (this.connection.Condition == null) { this.connection.Condition = new GameClasses.Condition(); this.connection.Condition.Predicates = new List<Predicate>(); } else { this.txtText.Text = this.connection.Condition.Text; } this.dgPredicates.ItemsSource = this.connection.Condition.Predicates; var lstItems = new List<ItemStrings>(); lstItems.AddRange(Globals.GameElements.Items); lstItems.AddRange(Globals.GameElements.Stats); lstItems.AddRange(Globals.GameElements.Skills); this.dgcmbPredicateName.ItemsSource = lstItems; List<PredicateTypeList> Dict = new List<PredicateTypeList>(); Dict.Add(new PredicateTypeList{ Key = PredicateTypes.eInventory, Value = "Inventory"}); Dict.Add(new PredicateTypeList { Key = PredicateTypes.eStat, Value = "Stat"}); Dict.Add(new PredicateTypeList{ Key = PredicateTypes.eSkill, Value = "Skill"}); this.dgcmbPredicateType.ItemsSource = Dict; }
public ChanceSettings(ConnectionXML conn) { InitializeComponent(); this.connection = conn; if (this.connection.Chance == null) { this.connection.Chance = new Chance(); this.connection.Chance.Text = "Опитай шанса си"; } this.txtProbability.Text = this.connection.Chance.Probability.ToString(); this.txtText.Text = this.connection.Chance.Text; this.connection.Type = ConnectionTypes.eChance; }
public BattleSettings(ConnectionXML conn) { InitializeComponent(); this.connection = conn; if (this.connection.Battle == null) { this.connection.Battle = new Battle(); this.connection.Battle.Text = "Бий се!"; } else { this.txtHealth.Text = this.connection.Battle.EnemyHealth.ToString(); this.txtStrength.Text = this.connection.Battle.EnemyStrength.ToString(); this.txtLose.Text = this.connection.Battle.Lose.ToString(); } this.txtText.Text = this.connection.Battle.Text; }
private void diagram_ConnectionManipulationCompleted_1(object sender, ManipulationRoutedEventArgs e) { ChooseConnectionType win = new ChooseConnectionType(); if (win.ShowDialog() == true) { var ConnectionContents = new ConnectionXML(); Window wind = null; switch (win.SelectedIndex) { case ConnectionTypes.eDecision: wind = new DecisionSettings(ConnectionContents); break; case ConnectionTypes.eChance: wind = new ChanceSettings(ConnectionContents); break; case ConnectionTypes.eBattle: wind = new BattleSettings(ConnectionContents); break; case ConnectionTypes.eCondition: wind = new ConditionSettings(ConnectionContents); break; case ConnectionTypes.eChanceRollback: { wind = new RollBackSettings(ConnectionContents); break; } case ConnectionTypes.eInventoryCondition: throw new ArgumentOutOfRangeException(); break; default: throw new ArgumentOutOfRangeException(); } ConnectionContents.Type = win.SelectedIndex; this.IgnoreSelection = true; if (wind != null && wind.ShowDialog() == true) { e.Connection.TargetCapType = CapType.Arrow1Filled; e.Connection.Content = ConnectionContents; return; } // this.IgnoreSelection = false; } this.diagram.RemoveConnection(e.Connection); }