本文整理汇总了C#中Goal类的典型用法代码示例。如果您正苦于以下问题:C# Goal类的具体用法?C# Goal怎么用?C# Goal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Goal类属于命名空间,在下文中一共展示了Goal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: navigateToStage
/// <summary>
/// Begins the boid walk to the stage
/// </summary>
private void navigateToStage()
{
GoalSeekingBehaviour behaviour = new LineOfSightGoalSeekingBehaviour(owner);
this.currentGoal = behaviour.ChooseClosestFromList(BootStrapper.EnvironmentManager.CurrentEnvironment.World.Stages);
owner.Behaviour = behaviour;
NextStep();
}
示例2: navigateToBar
/// <summary>
/// Begins the boid walk to the bar
/// </summary>
private void navigateToBar()
{
GoalSeekingBehaviour gsb = new GoalSeekingBehaviour(owner);
currentGoal = gsb.ChooseClosestFromList(BootStrapper.EnvironmentManager.CurrentEnvironment.World.Bars);
owner.Behaviour = gsb;
NextStep();
}
示例3: EstablishContext
protected override void EstablishContext()
{
//Prepare supplied data collections
suppliedStudentMetricBenchmarkAssessmentData = GetSuppliedStudentMetricBenchmarkAssessment();
suppliedSchoolGoal = GetSuppliedMetricGoal();
suppliedMetricState = GetSuppliedMetricState();
//Set up the mocks
metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
studentMetricBenchmarkAssessmentRepository = mocks.StrictMock<IRepository<StudentMetricBenchmarkAssessment>>();
metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>();
metricStateProvider = mocks.StrictMock<IMetricStateProvider>();
metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<StudentSchoolMetricInstanceSetRequest>>();
//Set expectations
Expect.Call(metricNodeResolver.GetMetricNodeForStudentFromMetricVariantId(suppliedSchoolId, suppliedMetricVariantId)).Return(GetMetricMetadataNode());
Expect.Call(studentMetricBenchmarkAssessmentRepository.GetAll()).Return(suppliedStudentMetricBenchmarkAssessmentData);
Expect.Call(
metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
.Constraints(
new ActionConstraint<StudentSchoolMetricInstanceSetRequest>(x =>
{
Assert.That(x.SchoolId == suppliedSchoolId);
Assert.That(x.MetricVariantId == suppliedMetricVariantId);
Assert.That(x.StudentUSI == suppliedStudentUSI);
})
).Return(suppliedMetricInstanceSetKey);
Expect.Call(metricGoalProvider.GetMetricGoal(suppliedMetricInstanceSetKey, suppliedMetricId)).Return(suppliedSchoolGoal);
Expect.Call(metricStateProvider.GetState(suppliedMetricId, suppliedMetricValueStr, "System.Double")).Repeat.Any().Return(suppliedMetricState);
Expect.Call(metricStateProvider.GetState(suppliedMetricId, "", "System.Double")).Return(suppliedMetricState);
}
示例4: EventGoalScored
public void EventGoalScored(Goal scoredOn)
{
if (scoredOn == Player1Goal)
{
Player2Score += 1;
p1scorestreak = 0;
int tmp = (int)Player2Goal.transform.localScale.y;
if (tmp > 1)
{
tmp -= 1;
Player2Goal.transform.localScale = new Vector3(1.5f, tmp, 1);
}
}
if (scoredOn == Player2Goal)
{
Player1Score += 1;
p2scorestreak = 0;
int tmp = (int)Player1Goal.transform.localScale.y;
if (tmp > 1)
{
tmp -= 1;
Player1Goal.transform.localScale = new Vector3(1.5f, tmp, 1);
}
}
}
示例5: Trigger
/// <summary>Initializes a new Trigger</summary>
/// <param name="parent">The <see cref="Goal"/> to which this object belongs.</param>
/// <remarks>Trigger set to <b>10</b>, "never (FALSE)".</remarks>
public Trigger(Goal parent)
{
_owner = parent;
GoalTrigger = new Mission.Trigger();
GoalTrigger.Condition = 10;
for (int i = 0; i < 3; i++) _strings[i] = "";
}
示例6: CheckForHighScores
public static bool CheckForHighScores(Goal goal)
{
if (!SaveDataControl.GoalHighScores.ContainsKey(goal.MiniDescription)) {
if((goal.HighScore != 0) | (goal.HighScore == 0 && !goal.HigherScoreIsGood))
SaveDataControl.GoalHighScores[goal.MiniDescription] = goal.HighScore;
SaveDataControl.Save();
return true;
}
if (goal.HigherScoreIsGood) {
if(SaveDataControl.GoalHighScores[goal.MiniDescription] < goal.HighScore) {
Debug.Log("new high score is " + goal.HighScore);
SaveDataControl.GoalHighScores[goal.MiniDescription] = goal.HighScore;
SaveDataControl.Save();
return true;
}
} else {
if(SaveDataControl.GoalHighScores[goal.MiniDescription] > goal.HighScore) {
Debug.Log("new high score is " + goal.HighScore);
SaveDataControl.GoalHighScores[goal.MiniDescription] = goal.HighScore;
SaveDataControl.Save();
return true;
}
}
return false;
}
示例7: EstablishContext
protected override void EstablishContext()
{
//Prepare supplied data collections
_suppliedStudentMetricAssessmentHistorical = GetSuppliedStudentMetricAssessmentHistorical();
_suppliedStudentMetricAssessmentHistoricalMetaData = GetSuppliedStudentMetricAssessmentHistoricalMetaData();
_suppliedSchoolGoal = GetSuppliedMetricGoal();
//Set up the mocks
_metricNodeResolver = mocks.StrictMock<IMetricNodeResolver>();
_studentMetricAssessmentHistorical = mocks.StrictMock<IRepository<StudentMetricAssessmentHistorical>>();
_studentMetricAssessmentHistoricalMetaData = mocks.StrictMock<IRepository<StudentMetricAssessmentHistoricalMetaData>>();
_metricGoalProvider = mocks.StrictMock<IMetricGoalProvider>();
_metricInstanceSetKeyResolver = mocks.StrictMock<IMetricInstanceSetKeyResolver<StudentSchoolMetricInstanceSetRequest>>();
//Set expectations
Expect.Call(_metricNodeResolver.GetMetricNodeForStudentFromMetricVariantId(SuppliedSchoolId, SuppliedMetricVariantId)).Return(GetMetricMetadataNode());
Expect.Call(_studentMetricAssessmentHistorical.GetAll()).Return(_suppliedStudentMetricAssessmentHistorical);
Expect.Call(_studentMetricAssessmentHistoricalMetaData.GetAll()).Return(_suppliedStudentMetricAssessmentHistoricalMetaData);
Expect.Call(
_metricInstanceSetKeyResolver.GetMetricInstanceSetKey(null))
.Constraints(
new ActionConstraint<StudentSchoolMetricInstanceSetRequest>(x =>
{
Assert.That(x.SchoolId == SuppliedSchoolId);
Assert.That(x.MetricVariantId == SuppliedMetricVariantId);
Assert.That(x.StudentUSI == SuppliedStudentUsi);
})
).Return(_suppliedMetricInstanceSetKey);
Expect.Call(_metricGoalProvider.GetMetricGoal(_suppliedMetricInstanceSetKey, SuppliedMetricId)).Return(_suppliedSchoolGoal);
}
示例8: InitializeGoals
public Goal[] InitializeGoals(int numberOfGods)
{
unusedGoals = new List<Goal> ();
GodChoiceMenu menu = gameObject.GetComponent<GodChoiceMenu> ();
//If godchoicemenu is unlocked, pick from the selected gods' goals; otherwise, pick from all goals
if(SaveDataControl.UnlockedGods.Count == 7) {
for(int i = 0; i < allGoals.Count; i++) {
for(int j = 0; j < menu.GodChoiceSelection.Length; j++) {
if(menu.GodChoiceSelection[j] && allGoals[i].God == ShopControl.AllGods[j]){
unusedGoals.Add(allGoals[i]);
}
}
}
} else {
for(int i = 0; i < allGoals.Count; i++) {
unusedGoals.Add(allGoals[i]);
}
}
Goal[] Goals = new Goal[numberOfGods];
for(int i = 0; i < numberOfGods; i++){
Goals[i] = new Goal();
int randomNumber = Random.Range (0, unusedGoals.Count);
Goals[i] = unusedGoals[randomNumber];
unusedGoals.RemoveAt(randomNumber);
}
return Goals;
}
示例9: Awake
protected void Awake()
{
if(sInstance != null)
{
Destroy(gameObject);
return;
}
sInstance = this;
if (mDungeon == null)
{
mDungeon = FindObjectOfType<Dungeon>();
}
if (mFollowCamera == null)
{
mFollowCamera = FindObjectOfType<FollowCamera>();
}
if(mFader == null)
{
mFader = FindObjectOfType<Fader>();
}
GameObject goalObj = SpawnPrefab(mGoalPrefab);
mGoal = goalObj.GetComponent<Goal>();
GameObject playerObj = SpawnPrefab(GlobalData.sSelectedCharacter == SelectedCharacter.Rose ? mPlayerRosePrefab : mPlayerVuPrefab);
mPlayer1 = playerObj.GetComponent<PlayerController>();
mFollowCamera.Init(mPlayer1.transform);
}
示例10: Awake
void Awake()
{
Think = new Think(gameObject);
Think.RemoveAllSubGoals();
Think.OnActivate();
}
示例11: Disjunction
public static Goal Disjunction(Goal goal1, Goal goal2)
{
return subst =>
{
var res = Disjunction(subst, goal1, goal2);
return res.Any() ? res.Select(s => new InfiniteSubstitutions(s)) : null;
};
}
示例12: Quest
public Quest(string n, string d, string o, int i, Goal[] newGoals )
{
name = n;
description = d;
objective = o;
iden = i;
goal = newGoals;
}
示例13: HasGoal
public bool HasGoal(Goal _g)
{
if (this.subGoals.Count > 0)
{
return subGoals[0] != _g;
}
return true;
}
示例14: NewLevelNewGoals
public void NewLevelNewGoals(int numberOfGods, Goal[] goals)
{
Goals = goals;
TurnOnExpoGUI ();
S.ShopAndGoalParentCanvasInst.NewLevelNewGoals (goals);
}
示例15: Awake
void Awake()
{
playerGoal = (Goal)GameObject.Find("PGoal").GetComponent(typeof(Goal));
shadowGoal = (Goal)GameObject.Find("SGoal").GetComponent(typeof(Goal));
player = GameObject.Find("Player");
shadow = GameObject.Find("Shadow");
spawner = (Spawner)gameObject.GetComponent(typeof(Spawner));
}