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


C# GameMode.age_check方法代码示例

本文整理汇总了C#中GameMode.age_check方法的典型用法代码示例。如果您正苦于以下问题:C# GameMode.age_check方法的具体用法?C# GameMode.age_check怎么用?C# GameMode.age_check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameMode的用法示例。


在下文中一共展示了GameMode.age_check方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: pollCandidates

		// Range: -1 Access: 0 Flags: ( 0, 4, 255 )
		public static ByTable pollCandidates( string Question = null, string jobbanType = null, GameMode gametypeCheck = null, dynamic be_special_flag = null, int? poll_time = null ) {
			ByTable candidates = null;
			int time_passed = 0;
			Mob_Dead_Observer G = null;
			Mob_Dead_Observer G2 = null;
			if ( be_special_flag == null ) {
				be_special_flag = 0;
			}
			if ( poll_time == null ) {
				poll_time = 300;
			}
			candidates = new ByTable();
			time_passed = Game13.time;
			if ( !Lang13.Bool( Question ) ) {
				Question = "Would you like to be a special role?";
			}
			G = null;
			foreach (dynamic _b in GlobalVars.player_list ) {
				if ( !( _b is Mob_Dead_Observer ) ) {
					continue;
				}
				G = _b;
				if ( !Lang13.Bool( ((dynamic)G).key ) || !Lang13.Bool( ((dynamic)G).client ) ) {
					continue;
				}
				if ( Lang13.Bool( be_special_flag ) ) {
					if ( !Lang13.Bool( ((dynamic)G).client.prefs.be_special & be_special_flag ) ) {
						continue;
					}
				}
				if ( gametypeCheck != null ) {
					if ( !gametypeCheck.age_check( ((dynamic)G).client ) ) {
						continue;
					}
				}
				if ( Lang13.Bool( jobbanType ) ) {
					if ( Lang13.Bool( GlobalFuncs.jobban_isbanned( G, jobbanType ) ) || Lang13.Bool( GlobalFuncs.jobban_isbanned( G, "Syndicate" ) ) ) {
						continue;
					}
				}
				Task13.schedule( 0, (Task13.Closure)(() => {
					((dynamic)G).write( "sound/misc/notice2.ogg" );
					dynamic _a = GlobalFuncs.askuser( G, Question, "Please answer in " + ( poll_time ??0) / 10 + " seconds!", "Yes", "No", null, false, poll_time ); // Was a switch-case, sorry for the mess.
					if ( _a==1 ) {
						((dynamic)G).write( "<span class='notice'>Choice registered: Yes.</span>" );
						if ( Game13.time - time_passed > ( poll_time ??0) ) {
							((dynamic)G).write( "<span class='danger'>Sorry, you were too late for the consideration!</span>" );
							((dynamic)G).write( "sound/machines/buzz-sigh.ogg" );
						} else {
							candidates += G;
						}
					} else if ( _a==2 ) {
						((dynamic)G).write( "<span class='danger'>Choice registered: No.</span>" );
					};
					return;
				}));
			};
			Task13.sleep( poll_time ??0 );
			G2 = null;
			foreach (dynamic _c in candidates ) {
				if ( !( _c is Mob_Dead_Observer ) ) {
					continue;
				}
				G2 = _c;
				if ( !Lang13.Bool( ((dynamic)G2).key ) || !Lang13.Bool( ((dynamic)G2).client ) ) {
					candidates.Remove( G2 );
				}
			};
			return candidates;
		}
开发者ID:bloxgate,项目名称:som--tg-station,代码行数:71,代码来源:GlobalFuncs.cs


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