本文整理汇总了C#中WorldState.GetSymbol方法的典型用法代码示例。如果您正苦于以下问题:C# WorldState.GetSymbol方法的具体用法?C# WorldState.GetSymbol怎么用?C# WorldState.GetSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldState
的用法示例。
在下文中一共展示了WorldState.GetSymbol方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProceduralPreConditions
public override bool ProceduralPreConditions(WorldState WorldState)
{
foreach (var item in unitsNeeded)
{
WorldSymbol WorldSymbol = WorldState.GetSymbol(item.Key);
if(WorldSymbol == null || WorldSymbol.GetSymbol<int>() < item.Value)
return false;
}
return true;
}
示例2: ApplyEffects
public override void ApplyEffects(WorldState WorldState)
{
///add one unit
WorldSymbol WorldSymbol = WorldState.GetSymbol(unitName);
if (WorldSymbol == null)
WorldSymbol = new WorldSymbol(unitName, 0);
WorldSymbol.SetSymbol<int>(WorldSymbol.GetSymbol<int>() + 1);
WorldState.SetSymbol(WorldSymbol);
////remove the resources
foreach (var item in resourcesNeeded)
{
WorldSymbol WorldSymbol2 = WorldState.GetSymbol(item.Key);
WorldSymbol2.SetSymbol<int>(WorldSymbol2.GetSymbol<int>() - item.Value);
WorldState.SetSymbol(WorldSymbol2);
}
}
示例3: ProceduralPreConditions
public override bool ProceduralPreConditions(WorldState WorldState)
{
foreach (var item in resourcesNeeded)
{
if (WorldState.GetSymbolValue<int>(item.Key) < item.Value)
return false;
}
if (WorldState.GetSymbol(HouseNeeded) == null || WorldState.GetSymbolValue<int>(HouseNeeded) == 0)
{
return false;
}
return true;
}
示例4: GetHeuristic
public override int GetHeuristic(WorldState WorldState)
{
if (WorldState.GetSymbol("EnemyKilled").GetSymbol<bool>() == false)
return 1;
return 0;
}