本文整理汇总了C#中Conditions类的典型用法代码示例。如果您正苦于以下问题:C# Conditions类的具体用法?C# Conditions怎么用?C# Conditions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Conditions类属于命名空间,在下文中一共展示了Conditions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConversationReference
/**
* Creates a new ConversationReference
*
* @param idTarget
* the id of the conversation that is referenced
*/
public ConversationReference(string idTarget)
{
this.idTarget = idTarget;
documentation = null;
conditions = new Conditions();
}
示例2: GetMaxHappiness
private static int GetMaxHappiness(Stack<string> atTable, List<string> free, Conditions conditions)
{
if (free.Count == 1)
{
atTable.Push(free.Single());
var table = new Table(atTable.ToList());
var totalHappiness = table.CalcTotalHappiness(conditions);
atTable.Pop();
return totalHappiness;
}
var maxHappiness = 0;
for (int i = 0; i < free.Count; i++)
{
atTable.Push(free[i]);
free.RemoveAt(i);
var happiness = GetMaxHappiness(atTable, free, conditions);
if (happiness > maxHappiness)
{
maxHappiness = happiness;
}
var person = atTable.Pop();
free.Insert(i, person);
}
return maxHappiness;
}
示例3: QueryConditionNode
public QueryConditionNode(QField lvalue, Conditions conditions, QConst rvalue)
: base()
{
_RValue = rvalue;
_Condition = conditions;
_LValue = lvalue;
}
示例4: ApplyCondition
public static double ApplyCondition(double quality, Conditions condition)
{
switch(condition)
{
case Conditions.Poor:
{
return quality * 0.5;
}
case Conditions.Normal:
{
return quality * 1;
}
case Conditions.Good:
{
return quality * 1.5;
}
case Conditions.Excellent:
{
return quality * 4;
}
default:
{
return quality * 1;
}
}
}
示例5: MissionCondition
public MissionCondition()
{
_condition = Conditions.None;
_checkValue = 0;
_name = GetName(_condition);
//_mission = null;
}
示例6: GetCondition
public static Conditions GetCondition(Random rng, Conditions previousCondition)
{
if(previousCondition == Conditions.Excellent)
{
return Conditions.Poor;
}
if(previousCondition == Conditions.Good || previousCondition == Conditions.Poor)
{
return Conditions.Normal;
}
int seed = rng.Next(1, 101);
if(seed > 75)
{
if(seed > 98)
{
return Conditions.Excellent;
}
else
{
return Conditions.Good;
}
}
else
{
return Conditions.Normal;
}
}
示例7: ResourcesUni
/**
* Creates a new Resources.
*/
public ResourcesUni()
{
assets = new Dictionary<string, string>();
// add the hash map of asset AllElements with asset
AllElementsWithAssets.addAsset(assets);
conditions = new Conditions();
name = "No name";
}
示例8: Car
public Car(string name, string details, int price, string type, string maker, int year, Conditions p):base(name, details, price)
{
this.Type = type;
this.Maker = maker;
this.YearMade = year;
this.state = p;
}
示例9: Barrier
/**
* Creates a new Exit
*
* @param x
* The horizontal coordinate of the upper left corner of the exit
* @param y
* The vertical coordinate of the upper left corner of the exit
* @param width
* The width of the exit
* @param height
* The height of the exit
*/
public Barrier(string id, int x, int y, int width, int height)
: base(id)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
conditions = new Conditions();
}
示例10: MapConditions2Json
public ConditionsJson MapConditions2Json(Conditions json)
{
return new ConditionsJson()
{
Chop = json.Chop,
Flatwater = json.Flatwater,
Waves = json.Waves
};
}
示例11: TimedAssessmentRule
/**
* Default constructor
*
* @param id
* Id of the rule
* @param importance
* Importance of the rule
*/
public TimedAssessmentRule(string id, int importance, bool repeatRule)
: base(id, importance, repeatRule)
{
effects = new List<TimedAssessmentEffect>();
this.endConditions = new Conditions();
usesEndConditions = true;
effectIndex = -1;
elapsedTime = 0;
isDone = false;
}
示例12: ElementReference
/**
* Creates a new ElementReference
*
* @param idTarget
* the id of the element that is referenced
* @param x
* the horizontal position of the element
* @param y
* the vertical position of the element
*/
public ElementReference(string idTarget, int x, int y)
{
this.idTarget = idTarget;
this.x = x;
this.y = y;
this.scale = 1;
this.layer = -1;
documentation = null;
conditions = new Conditions();
influenceArea = new InfluenceArea();
}
示例13: NextScene
/**
* Creates a new NextScene
*
* @param nextSceneId
* the id of the next scene
*/
public NextScene(string nextSceneId)
{
this.nextSceneId = nextSceneId;
destinyX = int.MinValue;
destinyY = int.MinValue;
conditions = new Conditions();
effects = new Effects();
postEffects = new Effects();
transitionType = NextSceneEnumTransitionType.NO_TRANSITION;
transitionTime = 0;
}
示例14: ParseElement
public override void ParseElement(XmlElement element)
{
XmlNodeList
names = element.SelectNodes("name"),
briefs = element.SelectNodes("brief"),
detaileds = element.SelectNodes("detailed"),
conditions = element.SelectNodes("condition");
string tmpArgVal;
foreach (XmlElement el in names)
{
string soundPath = "";
tmpArgVal = el.GetAttribute("soundPath");
if (!string.IsNullOrEmpty(tmpArgVal))
{
soundPath = tmpArgVal;
}
description.setNameSoundPath(soundPath);
description.setName(el.InnerText);
}
foreach (XmlElement el in briefs)
{
string soundPath = "";
tmpArgVal = el.GetAttribute("soundPath");
if (!string.IsNullOrEmpty(tmpArgVal))
{
soundPath = tmpArgVal;
}
description.setDescriptionSoundPath(soundPath);
description.setDescription(el.InnerText);
}
foreach (XmlElement el in detaileds)
{
string soundPath = "";
tmpArgVal = el.GetAttribute("soundPath");
if (!string.IsNullOrEmpty(tmpArgVal))
{
soundPath = tmpArgVal;
}
description.setDetailedDescriptionSoundPath(soundPath);
description.setDetailedDescription(el.InnerText);
}
foreach (XmlElement el in conditions)
{
currentConditions = new Conditions();
new ConditionSubParser_(currentConditions, chapter).ParseElement(el);
this.description.setConditions(currentConditions);
}
}
示例15: ActiveArea
/**
* Creates a new Exit
*
* @param rectangular
*
* @param x
* The horizontal coordinate of the upper left corner of the exit
* @param y
* The vertical coordinate of the upper left corner of the exit
* @param width
* The width of the exit
* @param height
* The height of the exit
*/
public ActiveArea(string id, bool rectangular, int x, int y, int width, int height)
: base(id)
{
this.rectangular = rectangular;
this.x = x;
this.y = y;
this.width = width;
this.height = height;
Vector2s = new List<Vector2>();
conditions = new Conditions();
influenceArea = new InfluenceArea();
}