本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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++;
}
}
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例13: VoteMap
public VoteMap(TasClient tas, Spring spring, AutoHost ah) : base(tas, spring, ah) { }
示例14: VoteForceStart
public VoteForceStart(TasClient tas, Spring spring, AutoHost ah) : base(tas, spring, ah) { }
示例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++;
}
}
}
}