Example #1
0
        public static PassGate GetPassGate(Passageway passageway, VolumetricBody body)
        {
            switch (body.GetType().ToString())
            {
            case "Wardrobe":
                return(new WardrobeThroughTheDoor(passageway as Door, body as Wardrobe));

            case "Bullet":
                return(new BulletThoughTheDoor(passageway as Door, body as Bullet));

            case "Tub":
                return(new TubThoughTheDoor(passageway as Door, body as Tub));

            default:
                return(new PassGate(passageway, body));
            }
        }
Example #2
0
        public void SetBodyOrGate(StackPanel stackPanel, ComboBox comboBox)
        {
            Dictionary <string, double> keyValuePairs = new Dictionary <string, double>();

            foreach (VariablesBlock variablesBlock in stackPanel.Children)
            {
                keyValuePairs.Add(variablesBlock.NameValue, variablesBlock.Value);
            }

            if (FormatterServices.GetUninitializedObject((comboBox.SelectedItem as MyType).ValueType) is Passageway)
            {
                passageway = FormatterServices.GetUninitializedObject((comboBox.SelectedItem as MyType).ValueType) as Passageway;
                passageway.SetParamValue(keyValuePairs);
            }
            else if (FormatterServices.GetUninitializedObject((comboBox.SelectedItem as MyType).ValueType) is VolumetricBody)
            {
                volumetricBody = FormatterServices.GetUninitializedObject((comboBox.SelectedItem as MyType).ValueType) as VolumetricBody;
                volumetricBody.SetParamValue(keyValuePairs);
            }
        }
Example #3
0
 public PassGate(Passageway passageway, VolumetricBody volumetricBody)
 {
     Gate  = passageway;
     VBody = volumetricBody;
 }