本文整理汇总了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.
}
示例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;
}
}
}
示例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);
}
示例4: HarvestVein
public HarvestVein(Expansion reqExpansion, double veinChance, double chanceToFallback, HarvestResource primaryResource, HarvestResource fallbackResource )
{
ReqExpansion = reqExpansion;
VeinChance = veinChance;
ChanceToFallback = chanceToFallback;
PrimaryResource = primaryResource;
FallbackResource = fallbackResource;
}
示例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 );
}
示例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;
}
示例7: OnExpansionChanged
protected override void OnExpansionChanged(Expansion old)
{
base.OnExpansionChanged(old);
if (EraML)
{
Stackable = true;
}
}
示例8: MakeNewbie
private static Item MakeNewbie(Item item, Expansion e)
{
if (e < Expansion.AOS)
{
item.LootType = LootType.Newbied;
}
return item;
}
示例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);
}
}
示例10: BonusHarvestResource
public BonusHarvestResource(Expansion reqExpansion, double reqSkill, double chance, TextDefinition message, Type type)
{
ReqExpansion = reqExpansion;
ReqSkill = reqSkill;
Chance = chance;
Type = type;
SuccessMessage = message;
}
示例11: OnExpansionChanged
protected override void OnExpansionChanged(Expansion old)
{
base.OnExpansionChanged(old);
if (0.3 > Utility.RandomDouble())
{
PackItem(Loot.RandomPossibleReagent(Expansion));
}
}
示例12: OnExpansionChanged
protected override void OnExpansionChanged(Expansion old)
{
base.OnExpansionChanged(old);
if (Expansion == Expansion.T2A)
{
ReplaceWith(new Silver(Amount));
}
}
示例13: BankBox
public BankBox(Mobile owner, Expansion e)
: base(0xE7C)
{
Owner = owner;
Expansion = e;
Movable = false;
Layer = Layer.Bank;
}
示例14: OnExpansionChanged
protected override void OnExpansionChanged(Expansion old)
{
base.OnExpansionChanged(old);
if (EraML)
{
Charges = Utility.RandomMinMax(1, 109);
}
}
示例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);
}