Ejemplo n.º 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));
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
 public static bool Inequality(Passageway passageway, double width, double height)
 {
     return(passageway.Width >= width && passageway.Height >= height);
 }
Ejemplo n.º 4
0
 public PassGate(Passageway passageway, VolumetricBody volumetricBody)
 {
     Gate  = passageway;
     VBody = volumetricBody;
 }