private static void LinkList2CalcProp(LinkList linkedThings, ConnectProperty calc)
 {
     calc.Connected.Clear();
     calc.Connected.AddRange(linkedThings?.Select(x => (x.PropertyID switch
     {
         "Gegen" => (x.Object as Handlung).Against,
         "Grenze" => (x.Object as Handlung).Limit,
         "DK" => (x.Object as Waffe).DK,
         "Precision" => (x.Object as Waffe).Precision,
         "Praezision" => (x.Object as Waffe).Precision,
         "RK" => (x.Object as Fernkampfwaffe).RK,
         "Reichweite" => (x.Object as Nahkampfwaffe).Reichweite,
         "Kapazitaet" => (x.Object as Panzerung).Capacity,
         "Angriff" => (x.Object as CyberDeck).Angriff,
         "Schleicher" => (x.Object as CyberDeck).Schleicher,
         "Firewall" => (x.Object as Kommlink).Firewall,
         "Datenverarbeitung" => (x.Object as Kommlink).Datenverarbeitung,
         "Sitze" => (x.Object as Vehikel).Sitze,
         "Sensor" => (x.Object as Vehikel).Sensor,
         "Rumpf" => (x.Object as Vehikel).Rumpf,
         "Pilot" => (x.Object as Vehikel).Pilot,
         "Panzerung" => (x.Object as Vehikel).Panzerung,
         "Handling" => (x.Object as Vehikel).Handling,
         "Gewicht" => (x.Object as Vehikel).Gewicht,
         "Geschwindigkeit" => (x.Object as Vehikel).Geschwindigkeit,
         "Beschleunigung" => (x.Object as Vehikel).Beschleunigung,
         _ => x.Object.Value,
     })));
Beispiel #2
0
        private void AddConnectedValuesToViewAndRegister(View Content, ConnectProperty charCalcProperty)
        {
            charCalcProperty.Connected.CollectionChanged += Connected_CollectionChanged;
            void Connected_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) => AddConnectedValuesToView(Content, charCalcProperty);

            AddConnectedValuesToView(Content, charCalcProperty);
        }
Beispiel #3
0
 /// <summary>
 /// Addes or removes selected items from the return list
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Selected_CheckedChanged(object sender, CheckedChangedEventArgs e)
 {
     if (sender is CheckBox box)
     {
         var entry = box.BindingContext switch
         {
             ConnectProperty p => p,
             Thing t => t.Value,
             _ => throw new ArgumentException(),
         };
         if (box.IsChecked)
         {
             if (!Selected.Contains(entry))
             {
                 Selected.Add(entry);
             }
         }
         else
         {
             if (Selected.Contains(entry))
             {
                 Selected.Remove(entry);
             }
         }
     }
 }
Beispiel #4
0
 public LinkListChooser(CharHolder myChar, ConnectProperty property)
 {
     MyChar     = myChar;
     MyProperty = property;
     Selected.AddRange(MyProperty.Connected);
     InitializeComponent();
     BindingContext = this;
 }
Beispiel #5
0
        public void IConvertable_Test()
        {
            var t = new Handlung();

            t.Value.BaseValue = 5;

            ConnectProperty tdp = 5;

            Assert.AreEqual(tdp.Value, t.Value.Value);
        }
Beispiel #6
0
        public void AktiveTest()
        {
            var t = new Item();

            t.Value.BaseValue = 5;

            ConnectProperty tdp = 5;

            Assert.AreEqual(tdp.Value, t.Value.Value);
        }
Beispiel #7
0
        private void AddConnectedValuesToView(View Content, ConnectProperty charCalcProperty)
        {
            var panel = Content.FindByName <StackLayout>("CalcPropertyPanel");

            panel.Children.Clear();
            foreach (var item in charCalcProperty.Connected)
            {
                var item1 = (Resources["ConnectedTemplate"] as DataTemplate).CreateContent() as View;
                item1.BindingContext = item;
                panel.Children.Add(item1);
            }
        }
Beispiel #8
0
 set => SetValue(ConnectProperty, value);