コード例 #1
0
ファイル: Race.cs プロジェクト: helios57/anrl
 public Race()
     : base()
 {
     competitors = new CompetitorCollection();
     competitorGroups = new CompetitorGroupCollection();
     flights = new FlightCollection();
 }
コード例 #2
0
ファイル: CompetitorSelection.cs プロジェクト: helios57/anrl
        private void compUpdateGrid()
        {
            if (race != null)
            {
                dataGridCompetitors.Columns.Clear();
                dataGridCompetitors.Columns.Add("CompetitionNumber", "Start No.");
                dataGridCompetitors.Columns.Add("AcCallsign", "AC Callsign");
                dataGridCompetitors.Columns.Add("PilotName", "Pilot Name");
                dataGridCompetitors.Columns.Add("PilotFirstName", "Pilot Firstname");
                dataGridCompetitors.Columns.Add("NavigatorName", "Navigator Name");
                dataGridCompetitors.Columns.Add("NavigatorFirstName", "Navigator Firstname");
                dataGridCompetitors.Columns.Add("Country", "County");

                dataGridCompetitors.Rows.Clear();
                CompetitorCollection availableCompetitors = new CompetitorCollection();
                availableCompetitors.AddRange(race.Competitors);

                foreach (CompetitorGroup cg in race.CompetitorGroups)
                {
                    foreach(CompetitorRouteAssignment cra in cg.CompetitorRouteAssignmentCollection)
                    {
                        availableCompetitors.Remove(cra.Competitor);
                    }
                }

                foreach (Competitor c in availableCompetitors)
                {
                    int index = dataGridCompetitors.Rows.Add(new object[] { c.CompetitionNumber, c.AcCallsign, c.PilotName, c.PilotFirstName, c.NavigatorName, c.NavigatorFirstName, c.Country });
                    dataGridCompetitors.Rows[index].Tag = c;
                }
            }
        }
コード例 #3
0
ファイル: Competition.cs プロジェクト: helios57/anrl
 public Competition()
     : base()
 {
     this.mapCollection = new MapCollection();
     this.competitorCollection = new CompetitorCollection();
     this.raceCollection = new RaceCollection();
     date = new DateTime();
 }
コード例 #4
0
ファイル: CompetitorGroup.cs プロジェクト: helios57/anrl
 public CompetitorGroup()
     : base()
 {
     id = Guid.NewGuid();
     competitors = new CompetitorCollection();
     startingTime = new DateTime();
     parcoursTime = new TimeSpan();
     competitorRouteAssignmentCollection = new CompetitorRouteAssignmentCollection();
 }
コード例 #5
0
ファイル: Race.cs プロジェクト: helios57/anrl
 public Race(string filename)
     : base()
 {
     competitors = new CompetitorCollection();
     competitorGroups = new CompetitorGroupCollection();
     flights = new FlightCollection();
     map = new Map();
     this.loadRace(filename);
 }
コード例 #6
0
ファイル: CompetitorGroup.cs プロジェクト: helios57/anrl
 public void moveUp(int index)
 {
     if (index > 0 - 1)
     {
         CompetitorCollection tempList = new CompetitorCollection();
         for (int i = competitors.Count - 1; i > 1; i--)
         {
             if (i == index)
             {
                 tempList.Add(this.competitors[i-1]);
                 tempList.Add(this.competitors[i]);
                 i -= 2;
             }
             else
             {
                 tempList.Add(this.competitors[i]);
                 i--;
             }
         }
         this.competitors = tempList;
     }
 }
コード例 #7
0
ファイル: CompetitorGroup.cs プロジェクト: helios57/anrl
 public void moveDown(int index)
 {
     if (index < this.competitors.Count - 1)
     {
         CompetitorCollection tempList = new CompetitorCollection();
         for (int i = 0; i < competitors.Count - 1; i++)
         {
             if (i == index)
             {
                 tempList.Add(this.competitors[i+1]);
                 tempList.Add(this.competitors[i]);
                 i += 2;
             }
             else
             {
                 tempList.Add(this.competitors[i]);
                 i++;
             }
         }
         this.competitors = tempList;
     }
 }
コード例 #8
0
ファイル: GroupsForm.cs プロジェクト: helios57/anrl
        private void compUpdateGrid()
        {
            if (competition != null)
            {
                dataGridCompetitors.Columns.Clear();
                dataGridCompetitors.Columns.Add("CompetitionNumber", "Start No.");
                dataGridCompetitors.Columns.Add("AcCallsign", "AC Callsign");
                dataGridCompetitors.Columns.Add("PilotName", "Pilot Name");
                dataGridCompetitors.Columns.Add("PilotFirstName", "Pilot Firstname");
                dataGridCompetitors.Columns.Add("NavigatorName", "Navigator Name");
                dataGridCompetitors.Columns.Add("NavigatorFirstName", "Navigator Firstname");
                dataGridCompetitors.Columns.Add("Country", "County");

                dataGridCompetitors.Rows.Clear();

                CompetitorCollection avilableCompetitors = new CompetitorCollection();
                foreach(Competitor comp in competition.CompetitorCollection)
                {
                    avilableCompetitors.Add(comp);
                }
                foreach (CompetitorGroup grp in race.CompetitorGroups)
                {
                    foreach (Competitor comp in grp.Competitors)
                    {
                        avilableCompetitors.Remove(comp);
                    }
                }
                foreach (Competitor c in competition.CompetitorCollection)
                {
                    int index = dataGridCompetitors.Rows.Add(new object[] { c.CompetitionNumber, c.AcCallsign, c.PilotName, c.PilotFirstName, c.NavigatorName, c.NavigatorFirstName, c.Country });
                    dataGridCompetitors.Rows[index].Tag = c;
                }
            }
        }
コード例 #9
0
 private void UpdateGridCompetitors(CompetitorCollection collection)
 {
     dataGridCompetitors.Rows.Clear();
     foreach (Competitor c in collection)
     {
         bool isSetMemberOfRace;
         if (race.Competitors.Count == 0)
         {
             isSetMemberOfRace = true;
         }
         else
         {
             isSetMemberOfRace = false;
         }
         if (race.Competitors.Contains(c))
         {
             isSetMemberOfRace = true;
         }
         int index = dataGridCompetitors.Rows.Add(new object[] { isSetMemberOfRace, null ,c.CompetitionNumber, c.AcCallsign, c.PilotName, c.PilotFirstName, c.NavigatorName, c.NavigatorFirstName, c.Country });
         dataGridCompetitors.Rows[index].Tag = c;
     }
 }
コード例 #10
0
 private void Submit()
 {
     selectedCompetitors = new CompetitorCollection();
     foreach (DataGridViewRow row in dataGridCompetitors.Rows)
     {
         if ((bool)(row.Cells["selected"]).Value)
         {
             selectedCompetitors.Add((Competitor)row.Tag);
         }
     }
     SubmitButtonClick(this, new EventArgs());
     this.Close();
 }
コード例 #11
0
ファイル: CompetitorCollection.cs プロジェクト: helios57/anrl
 public void AddRange(CompetitorCollection itemCollection)
 {
     foreach (Competitor item in itemCollection)
     {
         items.Add(item);
     }
 }
コード例 #12
0
ファイル: Race.cs プロジェクト: helios57/anrl
 public void loadRace(string filename)
 {
     BinaryFormatter binaryFormatter = new BinaryFormatter();
     Stream fStream = File.OpenRead(filename);
     Race r = (Race)binaryFormatter.Deserialize(fStream);
     this.competitors = r.Competitors;
     this.competitorGroups = r.CompetitorGroups;
     this.flights = r.Flights;
     this.map = r.map;
 }