Пример #1
0
        public FullSystemForm(int numberOfRaces, FullSystem fullSystem)
        {
            _numberOfRaces = numberOfRaces;
            _fullSystem = fullSystem;

            InitializeComponent();
        }
        public CheckWinningCombinationForm(FullSystem fs)
        {
            _fullSystem = fs;

            InitializeComponent();
        }
Пример #3
0
        public void CopyMainSelections(FullSystem other)
        {
            Debug.Assert(NumberOfRaces == other.NumberOfRaces);

            _developedCount = 0;

            _developedSystem.Clear();
            _unitBet = other._unitBet;
            _needsToBeSaved = true;
            _needsToBeCounted = true;
            _raceTrack = other._raceTrack;
            _date = other._date;
            FirstRace = other.FirstRace;
            AddNonExistingHorses(other);
            RemoveNonSelectedHorses(other);

            for (int i = 0; i < _group.Count; ++i)
            {
                var lim = _group[i];
                lim.SetFirstRace(FirstRace);
            }
        }
Пример #4
0
        private void AddNonExistingHorses(FullSystem other)
        {
            for (int raceNumber = 0; raceNumber < NumberOfRaces; ++raceNumber)
            {
                RaceSelection rs = other.GetRaceSelection(raceNumber);

                for (int j = 0; j < rs.Count; ++j)
                {
                    int horse = rs.Get(j);

                    if (false == GetRaceSelection(raceNumber).ContainsHorse(horse))
                    {
                        GetRaceSelection(raceNumber).AddHorse(horse);
                        // this can be eliminated by using a pointer to parent but let's live with it for a while May102008

                        for (int groupIndex = 0; groupIndex < _group.Count; ++groupIndex)
                        {
                            _group[groupIndex].AddHorse(raceNumber, horse);
                        }
                    }
                }
            }
        }
Пример #5
0
        private void Open(string filename)
        {
            _fullSystem = FullSystem.Make(filename);

            if (null != _fullSystem)
            {
                BindFullSystem();
                OnCount(null, null);
            }

            Text = "[ Exotic Studio ]  (c) Kasosoft 2008 - 2011  " + filename;

            _outputTextBox.Text = "";
        }
Пример #6
0
        private void RemoveNonSelectedHorses(FullSystem other)
        {
            for (int raceNumber = 0; raceNumber < NumberOfRaces; ++raceNumber)
            {
                RaceSelection rs = GetRaceSelection(raceNumber);

                for (int j = 0; j < rs.Count; ++j)
                {
                    int horse = rs.Get(j);

                    if (false == other.GetRaceSelection(raceNumber).ContainsHorse(horse))
                    {
                        GetRaceSelection(raceNumber).Remove(horse);

                        // this can be eliminated by using a pointer to parent but let's live with it for a while May102008

                        for (int groupIndex = 0; groupIndex < _group.Count; ++groupIndex)
                        {
                            _group[groupIndex].RemoveHorse(raceNumber, horse);
                        }

                        // The following statement that rolls back the index
                        // was missing, thus creating a nusty bug
                        // where a horse previously selected was not removed since its index
                        // was skipped after the removal ... June082008
                        // PLEASE BE CAREFULL IN SIMILAR SITUATIONS IN THE FUTURE!

                        --j;
                    }
                }
            }
        }
Пример #7
0
        private void OnEditFullSystem(object sender, EventArgs e)
        {
            var f = new FullSystemForm(_fullSystem.NumberOfRaces, _fullSystem);

            if (f.ShowDialog() == DialogResult.OK)
            {
                _fullSystem = f.GetFullSystem();
                BindFullSystem();
            }
        }
Пример #8
0
        private void OnNew(object sender, EventArgs e)
        {
            OnFormIsClosing(null, null);

            var selectRaces = new SelectNumberOfRacesForm();

            if (selectRaces.ShowDialog() == DialogResult.OK)
            {
                var f = new FullSystemForm(selectRaces.GetNumberOfRaces(), null);
                if (f.ShowDialog() == DialogResult.OK)
                {
                    _fullSystem = f.GetFullSystem();
                    BindFullSystem();
                    this.Text = "[ Exotic Studio ]  (c) Kasosoft 2008 - 2011   New System";
                    _outputTextBox.Text = "";
                }
            }
        }
Пример #9
0
        private void OnCloseDocument(object sender, EventArgs e)
        {
            OnFormIsClosing(null, null);

            _updateToolButtonsTimer.Stop();

            _fullSystem = null;

            BindFullSystem();

            _groupMatchesInputUserCtrl.BindFullSystem(_fullSystem);

            _updateToolButtonsTimer.Start();
        }
Пример #10
0
 public FrequenciesForm(FullSystem fs)
 {
     _fullSystem = fs;
     InitializeComponent();
 }
Пример #11
0
 public LimitationGroup(SerializationInfo info, StreamingContext ctxt)
 {
     _parent = null;
     _limitation = (ArrayList)info.GetValue("_limitationGroup", typeof(ArrayList));
 }
Пример #12
0
 public LimitationGroup(FullSystem parent)
 {
     _parent = parent;
 }
Пример #13
0
 public void SetParent(FullSystem parent)
 {
     _parent = parent;
 }