Exemple #1
0
        static void OnEnergyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            SystemLevel me = sender as SystemLevel;

            if (me != null)
            {
                me.CoolantNeed = Preset.CoolantLevelToPreventOverheat(me.EnergyLevel);
                me.Changed     = true;
            }
        }
Exemple #2
0
        static void OnCoolantChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            SystemLevel me = sender as SystemLevel;

            if (me != null)
            {
                me.Changed = true;
                me.RaiseEvent(new RoutedEventArgs(ValueChangedEvent));
            }
        }
Exemple #3
0
        static void OnChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            SystemLevel me = sender as SystemLevel;

            if (me != null)
            {
                if (me.Changed)
                {
                }
            }
        }
Exemple #4
0
        //if (_log.IsDebugEnabled) { _log.DebugFormat("Starting {0}", MethodBase.GetCurrentMethod().ToString()); }
        //if (_log.IsDebugEnabled) { _log.DebugFormat("Ending {0}", MethodBase.GetCurrentMethod().ToString()); }

        #region IMultiValueConverter Members

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string[] systems = { "Beam", "Torpedo", "Sensors", "Maneuvering", "Impulse", "Warp/Jump", "Front Shield", "Rear Shield" };
            string   retVal  = string.Empty;

            if (values != null)
            {
                SystemLevel sys = values[0] as SystemLevel;
                if (sys != null)
                {
                    Preset p = values[1] as Preset;
                    if (p != null)
                    {
                        retVal = systems[p.SystemLevels.IndexOf(sys)];
                    }
                }
            }
            return(retVal);
        }
Exemple #5
0
        void Initialize(bool isForOriginal)
        {
            SystemLevels = new ObservableCollection <SystemLevel>();

            TotalCoolantLevel = 0;
            for (int i = 0; i < 8; i++)
            {
                SystemLevel s = new SystemLevel(100, 0);
                s.Index         = i;
                s.ValueChanged += new RoutedEventHandler(s_ValueChanged);

                SystemLevels.Add(s);
            }


            if (!isForOriginal)
            {
                Original = new Preset(true);
            }
            else
            {
                Original = null;
            }
        }