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


C# SpringNamespace.Spring类代码示例

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


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

示例1: AutoHost

    public AutoHost(TasClient tas, Spring spring, AutoHostConfig conf)
    {
      if (conf == null) LoadConfig(); else config = conf;
      SaveConfig();

      this.tas = tas;
      this.spring = spring;

      tas.Said += new EventHandler<TasSayEventArgs>(tas_Said);

      pollTimer = new Timer(PollTimeout * 1000);
      pollTimer.Enabled = false;
      pollTimer.AutoReset = false;
      pollTimer.Elapsed += new ElapsedEventHandler(pollTimer_Elapsed);

      spring.SpringExited += new EventHandler(spring_SpringExited);
      spring.GameOver += new EventHandler<SpringLogEventArgs>(spring_GameOver);

      tas.BattleUserLeft += new EventHandler<TasEventArgs>(tas_BattleUserLeft);
      tas.UserRemoved += new EventHandler<TasEventArgs>(tas_UserRemoved);
      tas.UserStatusChanged += new EventHandler<TasEventArgs>(tas_UserStatusChanged);
      tas.BattleUserJoined += new EventHandler<TasEventArgs>(tas_BattleUserJoined);
      tas.BattleMapChanged += new EventHandler<TasEventArgs>(tas_BattleMapChanged);
      tas.BattleUserStatusChanged += new EventHandler<TasEventArgs>(tas_BattleUserStatusChanged);
      tas.BattleLockChanged += new EventHandler<TasEventArgs>(tas_BattleLockChanged);

      mapLinker = new MapLinker(spring);
      mapDownloader = new MapDownloader(spring);
      mapDownloader.DownloadCompleted += new EventHandler<TasEventArgs>(mapDownloader_DownloadCompleted);
      mapDownloader.DownloadProgressChanged += new EventHandler<TasEventArgs>(mapDownloader_DownloadProgressChanged);

      tas.BattleFound += new EventHandler<TasEventArgs>(tas_BattleFound);
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:33,代码来源:AutoHost.cs

示例2: FilterMaps

    internal static int FilterMaps(string[] words, TasClient tas, Spring spring, out string[] vals, out int[] indexes)
    {
      string[] temp = new string[spring.UnitSync.MapList.Keys.Count];
      int cnt = 0;
      foreach (string s in spring.UnitSync.MapList.Keys) { temp[cnt++] = s; }
      return Filter(temp, words, out vals, out indexes);

    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:8,代码来源:AutoHost_commands.cs

示例3: AutoManager

 public AutoManager(AutoHost ah, TasClient tas, Spring spring)
 {
   this.ah = ah;
   this.tas = tas;
   this.spring = spring;
   timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
   timer.Start();
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:8,代码来源:AutoManager.cs

示例4: FilterUsers

 internal static int FilterUsers(string[] words, TasClient tas, Spring spring, out string[] vals, out int[] indexes)
 {
   TasClient.Battle b = tas.GetBattle();
   string[] temp = new string[b.Users.Count];
   int i = 0;
   foreach (TasClient.UserBattleStatus u in b.Users) {
     temp[i++] = u.name;
   }
   return Filter(temp, words, out vals, out indexes);
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:10,代码来源:AutoHost_commands.cs

示例5: AutoUpdater

    /************************************************************************/
    /*    PUBLIC METHODS                                                    */
    /************************************************************************/

    /// <summary>
    /// Initializes auto downloader
    /// </summary>
    public AutoUpdater(Spring spring, TasClient tas)
    {
      this.spring = spring;
      this.tas = tas;

      timer = new Timer();
      timer.Interval = updateCheckInterval*1000*60;
      timer.AutoReset = true;
      timer.Elapsed += timer_Elapsed;
      timer.Start();
      spring.SpringExited += spring_SpringExited;
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:19,代码来源:AutoUpdater.cs

示例6: AutoUpdater

    /************************************************************************/
    /*    PUBLIC METHODS                                                    */
    /************************************************************************/
    /// <summary>
    /// Initializes auto downloader
    /// </summary>
    public AutoUpdater(Spring spring, TasClient tas)
    {
      this.spring = spring;
      this.tas = tas;

      timer = new System.Timers.Timer();
      timer.Interval = updateCheckInterval * 1000 * 60;
      timer.AutoReset = true;
      timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
      timer.Start();

      spring.SpringExited += new EventHandler(spring_SpringExited);
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:19,代码来源:AutoUpdater.cs

示例7: AbstractPoll

 public AbstractPoll(TasClient tas, Spring spring, AutoHost ah)
 {
   this.tas = tas;
   this.spring = spring;
   this.ah = ah;
   string[] usrs;
   int[] indexes;
   AutoHost.FilterUsers(new string[0], tas, spring, out usrs, out indexes);
   foreach (string s in usrs) {
     if (s != tas.UserName) {
       users.Add(s);
       votes.Add(0);
     }
   }
   initialUserCount = users.Count;
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:16,代码来源:Polls.cs

示例8: AbstractPoll

		public AbstractPoll(TasClient tas, Spring spring, AutoHost ah)
		{
			this.tas = tas;
			this.spring = spring;
			this.ah = ah;

			initialUserCount = 0;
			var b = tas.GetBattle();
			if (b != null) {
				foreach (var us in b.Users) {
					if (us.name != tas.UserName) {
						users.Add(us.name);
						votes.Add(0);
						if (!us.IsSpectator) initialUserCount++;
					}
				}
			}
		}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:18,代码来源:Polls.cs

示例9: Stats

    public Stats(TasClient tas, Spring spring)
    {
      this.tas = tas;
      this.spring = spring;

      LoadAccounts();

      tas.LoginAccepted += new EventHandler<TasEventArgs>(tas_LoginAccepted);
      if (Program.main.config.GargamelMode) {
        tas.UserRemoved += new EventHandler<TasEventArgs>(tas_UserRemoved);
        tas.BattleUserIpRecieved += new EventHandler<TasEventArgs>(tas_BattleUserIpRecieved);
        tas.UserStatusChanged += new EventHandler<TasEventArgs>(tas_UserStatusChanged);
      }
      spring.SpringStarted += new EventHandler(spring_SpringStarted);
      spring.PlayerJoined += new EventHandler<SpringLogEventArgs>(spring_PlayerJoined);
      spring.PlayerLeft += new EventHandler<SpringLogEventArgs>(spring_PlayerLeft);
      spring.PlayerLost += new EventHandler<SpringLogEventArgs>(spring_PlayerLost);
      spring.PlayerDisconnected += new EventHandler<SpringLogEventArgs>(spring_PlayerDisconnected);
      spring.GameOver += new EventHandler<SpringLogEventArgs>(spring_GameOver);
    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:20,代码来源:Stats.cs

示例10: Stats

		public Stats(TasClient tas, Spring spring)
		{
			this.tas = tas;
			this.spring = spring;

			LoadAccounts();

			tas.LoginAccepted += tas_LoginAccepted;
			if (Program.main.config.GargamelMode) {
				tas.UserRemoved += tas_UserRemoved;
				tas.BattleUserIpRecieved += tas_BattleUserIpRecieved;
				tas.UserStatusChanged += tas_UserStatusChanged;
			}
			spring.SpringStarted += spring_SpringStarted;
			spring.PlayerJoined += spring_PlayerJoined;
			spring.PlayerLeft += spring_PlayerLeft;
			spring.PlayerLost += spring_PlayerLost;
			spring.PlayerDisconnected += spring_PlayerDisconnected;
			spring.GameOver += spring_GameOver;
		}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:20,代码来源:Stats.cs

示例11: FilterMaps

 private static int FilterMaps(string[] words, TasClient tas, Spring spring, Ladder ladder, out string[] vals, out int[] indexes)
 {
   string[] temp = new string[spring.UnitSync.MapList.Keys.Count];
   int cnt = 0;
   foreach (string s in spring.UnitSync.MapList.Keys) {
     if (ladder != null) {
       if (ladder.Maps.Contains(s.ToLower())) temp[cnt++] = s;
     } else {
       string[] limit = Program.main.AutoHost.config.LimitMaps;
       if (limit != null && limit.Length > 0) {
         bool allowed = false;
         for (int i = 0; i < limit.Length; ++i) {
           if (s.ToLower().Contains(limit[i].ToLower())) {
             allowed = true;
             break;
           }
         }
         if (allowed) temp[cnt++] = s;
       } else temp[cnt++] = s;
     }
   }
   return Filter(temp, words, out vals, out indexes);
 }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:23,代码来源:AutoHost_commands.cs

示例12: AutoHost

    public AutoHost(TasClient tas, Spring spring, AutoHostConfig conf)
    {
      banList = new BanList(this, tas);

      if (conf == null) LoadConfig(); else config = conf;
      SaveConfig();

      this.tas = tas;
      this.spring = spring;

      tas.Said += new EventHandler<TasSayEventArgs>(tas_Said);

      pollTimer = new System.Timers.Timer(PollTimeout * 1000);
      pollTimer.Enabled = false;
      pollTimer.AutoReset = false;
      pollTimer.Elapsed += new ElapsedEventHandler(pollTimer_Elapsed);

      spring.SpringExited += new EventHandler(spring_SpringExited);
      spring.GameOver += new EventHandler<SpringLogEventArgs>(spring_GameOver);

      tas.BattleUserLeft += new EventHandler<TasEventArgs>(tas_BattleUserLeft);
      tas.UserStatusChanged += new EventHandler<TasEventArgs>(tas_UserStatusChanged);
      tas.BattleUserJoined += new EventHandler<TasEventArgs>(tas_BattleUserJoined);
      tas.BattleMapChanged += new EventHandler<TasEventArgs>(tas_BattleMapChanged);
      tas.BattleUserStatusChanged += new EventHandler<TasEventArgs>(tas_BattleUserStatusChanged);
      tas.BattleLockChanged += new EventHandler<TasEventArgs>(tas_BattleLockChanged);
      tas.BattleOpened += new EventHandler<TasEventArgs>(tas_BattleOpened);

      linker = new UnknownFilesLinker(spring);
      fileDownloader = new FileDownloader(spring);
      fileDownloader.DownloadCompleted += new EventHandler<FileDownloader.DownloadEventArgs>(fileDownloader_DownloadCompleted);
      //fileDownloader.DownloadProgressChanged += new EventHandler<TasEventArgs>(fileDownloader_DownloadProgressChanged);

      tas.BattleFound += new EventHandler<TasEventArgs>(tas_BattleFound);

    }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:36,代码来源:AutoHost.cs

示例13: VoteMap

 public VoteMap(TasClient tas, Spring spring, AutoHost ah) : base(tas, spring, ah) { }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:1,代码来源:Polls.cs

示例14: VoteForceStart

 public VoteForceStart(TasClient tas, Spring spring, AutoHost ah) : base(tas, spring, ah) { }
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:1,代码来源:Polls.cs

示例15: VotePlanet

		public VotePlanet(TasClient tas, Spring spring, AutoHost ah) : base(tas, spring, ah)
		{
			this.tas = tas;
			this.spring = spring;
			this.ah = ah;

			var pw = Program.main.PlanetWars;
			var fact = pw.GetOffensiveFaction();
			faction = fact.Name;

			users.Clear();
			votes.Clear();

			initialUserCount = 0;
			var b = tas.GetBattle();
			if (b != null) {
				foreach (var us in b.Users) {
					if (us.name != tas.UserName && !us.IsSpectator && pw.GetPlayerInfo(us.name).FactionName == faction) {
						users.Add(us.name);
						votes.Add(0);
						initialUserCount++;
					}
				}
			}
		}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:25,代码来源:Polls.cs


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