当前位置: 首页>>代码示例>>C#>>正文


C# WinShooterServerRemoting.Structs类代码示例

本文整理汇总了C#中Allberg.Shooter.WinShooterServerRemoting.Structs的典型用法代码示例。如果您正苦于以下问题:C# Structs类的具体用法?C# Structs怎么用?C# Structs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Structs类属于Allberg.Shooter.WinShooterServerRemoting命名空间,在下文中一共展示了Structs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: createPatrolHtmls

		private string createPatrolHtmls(Structs.Patrol patrol)
		{
			StringBuilder html = new StringBuilder();
			html.Append("<table>\r\n");
			html.Append("<tr>");
			html.Append("<td>Figur</td>");
			html.Append("<td>Namn</td>");
			html.Append("<td>Klass</td>");
			html.Append("<td>Vapen</td>");
			html.Append("</tr>\r\n");
			Structs.Competitor[] comps = myInterface.GetCompetitors(patrol);

			for(int lane=1;lane<=myInterface.GetCompetitions()[0].PatrolSize;lane++)
			{
				bool found = false;

				foreach(Structs.Competitor comp in comps)
				{
					if (comp.Lane == lane)
					{
						html.Append(createPatrolHtmlCompetitor(comp));
						found = true;
					}
				}

				if (!found)
				{
					html.Append(createPatrolHtmlEmpty(lane));
				}
			}
			
			html.Append("</table>\r\n");
			return html.ToString();
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:34,代码来源:CInternetExport.cs

示例2: createPatrolHeader

		private string createPatrolHeader(Structs.Patrol patrol)
		{
			StringBuilder html = new StringBuilder();
			html.Append("<b>Patrull " + patrol.PatrolId + " - " + 
				patrol.StartDateTime.ToShortTimeString() + "</b>\r\n");
			return html.ToString();
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:7,代码来源:CInternetExport.cs

示例3: GetResults

		internal ResultsReturn[] GetResults(
			Structs.ResultWeaponsClass wclass, 
			Structs.ShootersClass uclass,
			Structs.Competition competition,
			bool finalResults)
		{
			lock (resultHolders)
			{
				foreach (CResultHolder holder in resultHolders)
				{
					if (holder.WClass == wclass &&
						holder.UClass == uclass &&
						holder.NorwegianCount == competition.NorwegianCount &&
						holder.FinalResults == finalResults)
					{
						return holder.Results;
					}
				}

				ResultsReturn[] results = result.GetResults(wclass,
					uclass,
					competition,
					finalResults);

				CResultHolder newHolder = new CResultHolder(
					wclass,
					uclass,
					competition.NorwegianCount,
					finalResults,
					results);
				resultHolders.Add(newHolder);

				return results;
			}
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:35,代码来源:CResultCache.cs

示例4: CPrintResultLabels

		internal CPrintResultLabels(ref Common.Interface newCommon, 
			Structs.Patrol PatrolToPrint, 
			int AlreadyPrintedLabels)
			: base()  
		{
			CommonCode = newCommon;
			Patrol = PatrolToPrint;
			labelCount = AlreadyPrintedLabels;
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:9,代码来源:CPrintResultLabels.cs

示例5: ConvertWeaponsClassToResultClass

		static internal Structs.ResultWeaponsClass ConvertWeaponsClassToResultClass(
			Structs.WeaponClass weapon, Structs.CompetitionTypeEnum compType)
		{
			switch(compType)
			{
				case Structs.CompetitionTypeEnum.MagnumField:
				{
					switch(weapon)
					{
						case Structs.WeaponClass.M1:
							return Structs.ResultWeaponsClass.M1;
						case Structs.WeaponClass.M2:
							return Structs.ResultWeaponsClass.M2;
						case Structs.WeaponClass.M3:
							return Structs.ResultWeaponsClass.M3;
						case Structs.WeaponClass.M4:
							return Structs.ResultWeaponsClass.M4;
						case Structs.WeaponClass.M5:
							return Structs.ResultWeaponsClass.M5;
						case Structs.WeaponClass.M6:
							return Structs.ResultWeaponsClass.M6;
						case Structs.WeaponClass.M7:
							return Structs.ResultWeaponsClass.M7;
						case Structs.WeaponClass.M8:
							return Structs.ResultWeaponsClass.M8;
						case Structs.WeaponClass.M9:
							return Structs.ResultWeaponsClass.M9;
						default:
							throw new CannotFindIdException("WeaponClass " + 
								weapon + " is not used in MagnumField");
					}
				}
				default:
				{
					switch(weapon)
					{
						case Structs.WeaponClass.A1:
							return Structs.ResultWeaponsClass.A;
						case Structs.WeaponClass.A2:
							return Structs.ResultWeaponsClass.A;
						case Structs.WeaponClass.A3:
							return Structs.ResultWeaponsClass.A;
						case Structs.WeaponClass.B:
							return Structs.ResultWeaponsClass.B;
						case Structs.WeaponClass.C:
							return Structs.ResultWeaponsClass.C;
						case Structs.WeaponClass.M:
							return Structs.ResultWeaponsClass.M;
						case Structs.WeaponClass.R:
							return Structs.ResultWeaponsClass.R;
						default:
							throw new CannotFindIdException("Weaponclass " + 
								weapon + " could not be found.");
					}
				}
			}
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:57,代码来源:CConvert.cs

示例6: CPrintResultlistByPatrol

		internal CPrintResultlistByPatrol(ref Common.Interface newCommon, 
			Structs.Patrol patrolToPrint) : base ()  
		{
			CommonCode = newCommon;
			patrol = patrolToPrint;

			Structs.Competition competition = CommonCode.GetCompetitions()[0];
			CompetitionType =
				competition.Type;
			this.NorwegianCount = competition.NorwegianCount;
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:11,代码来源:CPrintResultlistByPatrol.cs

示例7: CResultHolder

		internal CResultHolder(Structs.ResultWeaponsClass wclass, 
			Structs.ShootersClass uclass,
			bool norwegianCount,
			bool finalResults,
			ResultsReturn[] results)
		{
			WClass = wclass;
			UClass = uclass;
			NorwegianCount = norwegianCount;
			FinalResults = finalResults;
			Results = results;
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:12,代码来源:CResultHolder.cs

示例8: GetTeamResults

		internal ResultsReturnTeam[] GetTeamResults(Structs.ResultWeaponsClass wclass, 
			Structs.Competition competition)
		{
			Trace.WriteLine("CResults.GetResults(" + wclass.ToString() +
				") started on thread \"" +
				System.Threading.Thread.CurrentThread.Name + "\" ( " +
				System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");

			while (resultsAlreadyRunning)
				System.Threading.Thread.Sleep(50);

			Trace.WriteLine("CResults: GetResults() " + 
				" locking \"GetResultsLock\" on thread \"" +
				Thread.CurrentThread.Name + "\" ( " +
				System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");

			lock(GetResultsLock)
			{
				Trace.WriteLine("CResults: GetResults() " + 
					" locked \"GetResultsLock\" on thread \"" +
					Thread.CurrentThread.Name + "\" ( " +
					System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");

				try
				{
					resultsAlreadyRunning = true;
					CompetitionType = myInterface.CompetitionCurrent.Type;
					database = myInterface.databaseClass.Database;

					useNorwegianCount = competition.NorwegianCount;

					// Ok, now lets count the real ones
					DSResults results = getAllTeams(wclass);
					results = sortTeams(results);

					ResultsReturnTeam[] toReturn = 
						convertIntoArray(results);

					return toReturn;
				}
				finally
				{
					Trace.WriteLine("CResultsTeam: GetResults() " + 
						" unlocking \"GetResultsLock\" on thread \"" +
						Thread.CurrentThread.Name + "\" ( " +
						System.Threading.Thread.CurrentThread.ManagedThreadId.ToString() + " )");

					Trace.WriteLine("CResults.GetResults ended.");
					resultsAlreadyRunning = false;
				}
			}
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:52,代码来源:CResultTeam.cs

示例9: ExportResults

		internal byte[] ExportResults(Structs.ResultWeaponsClass wclass,
			Structs.ShootersClass uclass, bool finalResults)
		{
			ResultsReturn[] results =
				myInterface.resultClass.GetResults(
				wclass,
				uclass,
				myInterface.CompetitionCurrent);

			string resultString = RenderResults(results);

			Encoding enc = ASCIIEncoding.GetEncoding(1252);
			return enc.GetBytes(resultString);
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:14,代码来源:CInternetExcelExport.cs

示例10: CPrintResultlist

		internal CPrintResultlist(ref Common.Interface newCommon, 
			Structs.ResultWeaponsClass wclasswanted,
			Structs.ShootersClass uclasswanted,
			bool prelResults,
			string clubIdwanted) : base ()  
		{
			CommonCode = newCommon;
			wclass = wclasswanted;
			uclass = uclasswanted;
			printPrelResults = prelResults;
			clubId = clubIdwanted;

			competition = CommonCode.GetCompetitions()[0];
			CompetitionType = competition.Type;
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:15,代码来源:CPrintResultlist.cs

示例11: getAllTeams

		private DSResults getAllTeams(Structs.ResultWeaponsClass wclass)
		{
			DSResults results = new DSResults();

			// Add columns for each station (used later for sorting)
			int stationCount = myInterface.GetStationsCount();
			for(int stationNr=1;stationNr<=stationCount;stationNr++)
			{
				results.TeamResults.Columns.Add("Station" + stationNr.ToString(), typeof(int));
			}
			if (myInterface.CompetitionCurrent.Type == Structs.CompetitionTypeEnum.Precision)
			{
				for(int stationNr=myInterface.GetStationsCount();stationNr>=1;stationNr--)
				{
					for(int i=10; i>0; i--)
					{
						results.TeamResults.Columns.Add("Station" + stationNr.ToString() + "-" + i.ToString(), typeof(int));
					}
				}
			}

			foreach(DatabaseDataset.TeamsRow teamrow in database.Teams)
			{
				if (teamrow.WClass == (int)wclass)
				{
					ArrayList comps = new ArrayList();

					if (!teamrow.IsCompetitorId1Null())
						comps.Add((DatabaseDataset.CompetitorsRow)
							database.Competitors.Select("CompetitorId=" + teamrow.CompetitorId1.ToString())[0]);
					if (!teamrow.IsCompetitorId2Null())
						comps.Add((DatabaseDataset.CompetitorsRow)
							database.Competitors.Select("CompetitorId=" + teamrow.CompetitorId2.ToString())[0]);
					if (!teamrow.IsCompetitorId3Null())
						comps.Add((DatabaseDataset.CompetitorsRow)
							database.Competitors.Select("CompetitorId=" + teamrow.CompetitorId3.ToString())[0]);
					if (!teamrow.IsCompetitorId4Null())
						comps.Add((DatabaseDataset.CompetitorsRow)
							database.Competitors.Select("CompetitorId=" + teamrow.CompetitorId4.ToString())[0]);
					if (!teamrow.IsCompetitorId5Null())
						comps.Add((DatabaseDataset.CompetitorsRow)
							database.Competitors.Select("CompetitorId=" + teamrow.CompetitorId5.ToString())[0]);

					Hashtable teamHits = new Hashtable();
					Hashtable teamFigureHits = new Hashtable();
					Hashtable teamCountNrOfTens = new Hashtable();

					int totPoints = 0;
					foreach(DatabaseDataset.CompetitorsRow compsRow in
						(DatabaseDataset.CompetitorsRow[])
						comps.ToArray(typeof(DatabaseDataset.CompetitorsRow)))
					{
						foreach(DatabaseDataset.CompetitorResultsRow compresrow in
							(DatabaseDataset.CompetitorResultsRow[])
							compsRow.GetChildRows("CompetitorsCompetitorResults"))
						{
							DatabaseDataset.StationsRow stationsRow =
								(DatabaseDataset.StationsRow)database.Stations.Select("StationId=" + compresrow.StationId.ToString())[0];
							
							int teamHitsThisStn = 0;
							if (teamHits.ContainsKey(stationsRow.StationNr))
								teamHitsThisStn = (int)teamHits[stationsRow.StationNr];

							int teamFigureHitsThisStn = 0;
							if (teamFigureHits.ContainsKey(stationsRow.StationNr))
								teamFigureHitsThisStn = (int)teamFigureHits[stationsRow.StationNr];

							teamHitsThisStn += compresrow.Hits;
							teamFigureHitsThisStn += compresrow.FigureHits;
							totPoints += compresrow.Points;

							teamHits[stationsRow.StationNr] = teamHitsThisStn;
							teamFigureHits[stationsRow.StationNr] = teamFigureHitsThisStn;
							if (CompetitionType == Structs.CompetitionTypeEnum.Precision)
							{
								foreach(string strn in compresrow.StationFigureHits.Split(';'))
								{
									if (strn != "" && int.Parse(strn) != 0)
									{
										string columnName = "Station" + stationsRow.StationNr.ToString() + "-" +
											strn;
										int thisValue = 0;
										if (teamCountNrOfTens.ContainsKey(columnName))
											thisValue = (int)teamCountNrOfTens[columnName];
										thisValue++;
										teamCountNrOfTens[columnName] = thisValue;
									}
								}
							}
						}
					}

					int totFigureHits = 0;
					int totHits = 0;
					string stnHits = "";
					DSResults.TeamResultsRow newTeamRow = 
						results.TeamResults.NewTeamResultsRow();

					if (myInterface.GetCompetitions()[0].Type == Structs.CompetitionTypeEnum.Precision)
					{
//.........这里部分代码省略.........
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:101,代码来源:CResultTeam.cs

示例12: GetPatrols

		public Structs.Patrol[] GetPatrols(Structs.PatrolClass patrolClass, 
			bool AlsoIncludeUnknownClass,
			bool OnlyIncludePatrolsWithSpace,
			int PatrolIdToAlwaysView)
		{
			if (serverInterface != null)
			{
				//serverInterface.Sync();
				return serverInterface.GetPatrols(patrolClass,
					AlsoIncludeUnknownClass, OnlyIncludePatrolsWithSpace,
					PatrolIdToAlwaysView);
			}
			else
			{
				if (databaseClass.Database == null)
					throw new ApplicationException(
						"Database not initialized when trying to fetch Patrols");

				return databaseClass.getPatrols(patrolClass, 
					AlsoIncludeUnknownClass, OnlyIncludePatrolsWithSpace,
					PatrolIdToAlwaysView);
			}
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:23,代码来源:Interface.cs

示例13: ConvertWeaponsClassToResultClass

		/// <summary>
		/// Converts WeaponsClass to ResultClass
		/// </summary>
		/// <param name="weapon">Weapon</param>
		/// <returns></returns>
		public Structs.ResultWeaponsClass ConvertWeaponsClassToResultClass(
			Structs.WeaponClass weapon)
		{
			return CConvert.ConvertWeaponsClassToResultClass(weapon, CompetitionCurrent.Type);
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:10,代码来源:Interface.cs

示例14: ResultsGetCompetitor

		internal ResultsReturn ResultsGetCompetitor(
			Structs.Competitor competitor)
		{
			return result.ResultsGetCompetitor(competitor);
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:5,代码来源:CResultCache.cs

示例15: GetShooters

		public Structs.Shooter[] GetShooters(Structs.Club ClubToFetch)
		{
			if (serverInterface != null)
			{
				//serverInterface.Sync();
				return serverInterface.GetShooters(ClubToFetch);
			}
			else
			{
				if (databaseClass.Database == null)
					throw new ApplicationException(
						"Database not initialized when trying to fetch Shooters");

				return databaseClass.GetShooters(ClubToFetch);
			}
		}
开发者ID:WinShooter,项目名称:WinShooter-Legacy,代码行数:16,代码来源:Interface.cs


注:本文中的Allberg.Shooter.WinShooterServerRemoting.Structs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。