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


C# Expansion类代码示例

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


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

示例1: EmptyExpansionExists

 public static bool EmptyExpansionExists(Expansion expansion)
 {
     if (expansion is NonTerminal)
         return ((NonTerminal) expansion).Production.IsEmptyPossible;
     else if (expansion is Action)
         return true;
     else if (expansion is RegularExpression)
         return false;
     else if (expansion is OneOrMore)
         return EmptyExpansionExists(((OneOrMore) expansion).Expansion);
     else if (expansion is ZeroOrMore || expansion is ZeroOrOne)
         return true;
     else if (expansion is Lookahead)
         return true;
     else if (expansion is Choice) {
         foreach (var choice in ((Choice) expansion).Choices) {
             if (EmptyExpansionExists(choice))
                 return true;
         }
         return false;
     } else if (expansion is Sequence) {
         foreach (var unit in ((Sequence) expansion).Units) {
             if (!EmptyExpansionExists(unit))
                 return false;
         }
         return true;
     } else if (expansion is TryBlock)
         return EmptyExpansionExists(((TryBlock) expansion).Expansion);
     else
         return false; // This should be dead code.
 }
开发者ID:ArsenShnurkov,项目名称:csharpcc,代码行数:31,代码来源:Semanticize.cs

示例2: EnsureLoaded

        private void EnsureLoaded()
        {
            using (new ReaderLock(_lock))
            {
                if (_loaded) return;

                using (new WriterLock(_lock))
                {
                    if (_loaded) return;

                    if (null == _cache)
                        _cache = new List<Expansion>();

                    Connection.ExecuteSql(new Query(EXPANSION_SELECT), delegate(SqlDataReader reader)
                    {
                        while (reader.Read())
                        {
                            if (null != _cache.Find(c => reader[0].ToString() == c.Name))
                                return;

                            var newExpansion = new Expansion()
                            {
                                Name = reader[0].ToString()
                            };

                            _cache.Add(newExpansion);
                        }
                    });

                    _loaded = true;
                }
            }
        }
开发者ID:anxkha,项目名称:DRM,代码行数:33,代码来源:ExpansionStore.cs

示例3: RegisterMap

		public static void RegisterMap(
			int mapIndex, int mapID, int fileIndex, int width, int height, Season season, Expansion ex, string name, MapRules rules)
		{
			var newMap = new Map(mapID, mapIndex, fileIndex, width, height, season.GetID(), ex, name, rules);

			Map.Maps[mapIndex] = newMap;
			Map.AllMaps.Add(newMap);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:8,代码来源:MapDefinitions.cs

示例4: HarvestVein

		public HarvestVein(Expansion reqExpansion, double veinChance, double chanceToFallback, HarvestResource primaryResource, HarvestResource fallbackResource )
		{
			ReqExpansion = reqExpansion;
			VeinChance = veinChance;
			ChanceToFallback = chanceToFallback;
			PrimaryResource = primaryResource;
			FallbackResource = fallbackResource;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:8,代码来源:HarvestVein.cs

示例5: RewardEntry

		public RewardEntry( RewardCategory category, int name, Type itemType, params object[] args )
		{
			m_Category = category;
			m_ItemType = itemType;
			m_RequiredExpansion = Expansion.None;
			m_Name = name;
			m_Args = args;
			category.Entries.Add( this );
		}
开发者ID:Godkong,项目名称:Origins,代码行数:9,代码来源:RewardEntry.cs

示例6: HarvestResource

		public HarvestResource( Expansion reqExpansion, double reqSkill, double minSkill, double maxSkill, object message, params Type[] types )
		{
			ReqExpansion = reqExpansion;
			ReqSkill = reqSkill;
			MinSkill = minSkill;
			MaxSkill = maxSkill;
			Types = types;
			SuccessMessage = message;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:HarvestResource.cs

示例7: OnExpansionChanged

		protected override void OnExpansionChanged(Expansion old)
		{
			base.OnExpansionChanged(old);

			if (EraML)
			{
				Stackable = true;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:ZombieSkinDye.cs

示例8: MakeNewbie

		private static Item MakeNewbie(Item item, Expansion e)
		{
			if (e < Expansion.AOS)
			{
				item.LootType = LootType.Newbied;
			}

			return item;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:CharacterCreation.cs

示例9: LoadExpansion

 public static void LoadExpansion(string name, Expansion expansion)
 {
     expansions.Add(name, expansion);
     foreach (var card in expansion.CardSet)
     {
         card.Id = cardSet.Count;
         cardSet.Add(card);
     }
 }
开发者ID:h1398123,项目名称:sgs,代码行数:9,代码来源:GameEngine.cs

示例10: BonusHarvestResource

		public BonusHarvestResource(Expansion reqExpansion, double reqSkill, double chance, TextDefinition message, Type type)
		{
			ReqExpansion = reqExpansion;
			ReqSkill = reqSkill;

			Chance = chance;
			Type = type;
			SuccessMessage = message;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:BonusHarvestResource.cs

示例11: OnExpansionChanged

		protected override void OnExpansionChanged(Expansion old)
		{
			base.OnExpansionChanged(old);

			if (0.3 > Utility.RandomDouble())
			{
				PackItem(Loot.RandomPossibleReagent(Expansion));
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:OrcishLord.cs

示例12: OnExpansionChanged

		protected override void OnExpansionChanged(Expansion old)
		{
			base.OnExpansionChanged(old);

			if (Expansion == Expansion.T2A)
			{
				ReplaceWith(new Silver(Amount));
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:Gold.cs

示例13: BankBox

		public BankBox(Mobile owner, Expansion e)
			: base(0xE7C)
		{
			Owner = owner;
			Expansion = e;

			Movable = false;
			Layer = Layer.Bank;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:Containers.cs

示例14: OnExpansionChanged

		protected override void OnExpansionChanged(Expansion old)
		{
			base.OnExpansionChanged(old);

			if (EraML)
			{
				Charges = Utility.RandomMinMax(1, 109);
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:GreaterHealWand.cs

示例15: SetPlayerExpansion

        public static async Task SetPlayerExpansion(string username, Expansion exp)
        {

            if (_tcm.Online)
                await GetClient().SendMessage(TCCommand.SetPlayerExpansion.BuildCommand(username, ((int)exp).ToString()));
            else
                await _tcm.AuthDatabase.ChangeAccountExpansion(username, exp);


        }
开发者ID:TrinityCore-Manager,项目名称:TrinityCore-Manager-v3,代码行数:10,代码来源:TCAction.cs


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