本文整理汇总了C#中Goal类的典型用法代码示例。如果您正苦于以下问题:C# Goal类的具体用法?C# Goal怎么用?C# Goal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Goal类属于命名空间,在下文中一共展示了Goal类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:aaronbloom,项目名称:crowd-simulation,代码行数:10,代码来源:DanceProcess.cs
示例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();
}
开发者ID:aaronbloom,项目名称:crowd-simulation,代码行数:10,代码来源:BarProcess.cs
示例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);
}
开发者ID:sybrix,项目名称:EdFi-App,代码行数:31,代码来源:BenchmarkHistoricalChartServiceFixture.cs
示例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);
}
}
}
开发者ID:rowlandsc,项目名称:GMAP348GroupProjects,代码行数:26,代码来源:GameManager.cs
示例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] = "";
}
开发者ID:MikeG621,项目名称:Platform,代码行数:10,代码来源:Globals.Goal.Trigger.cs
示例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;
}
开发者ID:kenning,项目名称:popul-vuh,代码行数:28,代码来源:SaveDataControl.cs
示例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);
}
开发者ID:sybrix,项目名称:EdFi-App,代码行数:30,代码来源:StudentMetricAssessmentHistoricalServiceFixture.cs
示例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;
}
开发者ID:kenning,项目名称:popul-vuh,代码行数:31,代码来源:GoalLibrary.cs
示例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);
}
开发者ID:stregawolf,项目名称:VDayJam2016,代码行数:31,代码来源:GameManager.cs
示例10: Awake
void Awake()
{
Think = new Think(gameObject);
Think.RemoveAllSubGoals();
Think.OnActivate();
}
开发者ID:luukholleman,项目名称:Imperator-Fundum,代码行数:8,代码来源:GoalBehaviour.cs
示例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;
};
}
开发者ID:WinMustDie,项目名称:miniKanren,代码行数:8,代码来源:MicroKanren.cs
示例12: Quest
public Quest(string n, string d, string o, int i, Goal[] newGoals )
{
name = n;
description = d;
objective = o;
iden = i;
goal = newGoals;
}
开发者ID:chicostategamestudios,项目名称:qk-pop,代码行数:8,代码来源:Quests.cs
示例13: HasGoal
public bool HasGoal(Goal _g)
{
if (this.subGoals.Count > 0)
{
return subGoals[0] != _g;
}
return true;
}
开发者ID:Ashen-Vaults,项目名称:Unity-Path-Finder,代码行数:8,代码来源:GoalList.cs
示例14: NewLevelNewGoals
public void NewLevelNewGoals(int numberOfGods, Goal[] goals)
{
Goals = goals;
TurnOnExpoGUI ();
S.ShopAndGoalParentCanvasInst.NewLevelNewGoals (goals);
}
开发者ID:kenning,项目名称:popul-vuh,代码行数:8,代码来源:ShopControlGUI.cs
示例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));
}
开发者ID:adahera222,项目名称:Equate,代码行数:8,代码来源:GlobalControls.cs
示例16: SetUp
public void SetUp()
{
var root = new TestFileSystemDirectory("root");
var goalx86 = new Goal("debug-x86", new[] { Suite.DebugGoal, new Goal("x86") });
var goalx64 = new Goal("debug-x64", new[] { Suite.DebugGoal, new Goal("x64") });
x86Suite = new Suite(root, new[] {goalx86, goalx64}, goalx86);
x64Suite = new Suite(root, new[] {goalx86, goalx64}, goalx64);
}
开发者ID:zvrana,项目名称:bari,代码行数:9,代码来源:VCppProjectMIDLParametersTest.cs
示例17: RequiresExplicitActiveGoalIfCommandNeedsIt
public void RequiresExplicitActiveGoalIfCommandNeedsIt()
{
commandEnumerator.Setup(c => c.NeedsExplicitTargetGoal(It.IsAny<string>())).Returns(true);
var factory = new DefaultSuiteFactory(parameters.Object, suiteRoot, commandEnumerator.Object);
var goal1 = new Goal("goal1");
factory.CreateSuite(new HashSet<Goal>(new[] { goal1 }), Suite.DebugGoal);
}
开发者ID:vigoo,项目名称:bari,代码行数:9,代码来源:DefaultSuiteFactoryTest.cs
示例18: Post
public HttpResponseMessage Post(Goal model)
{
if (!ModelState.IsValid)
{
throw new HttpResponseException(HttpStatusCode.BadRequest);
}
_goalService.Add(model);
return Request.CreateResponse<Goal>(HttpStatusCode.Created, model);
}
开发者ID:CloudMetal,项目名称:Liveo.Deployment,代码行数:9,代码来源:GoalApiController.cs
示例19: SelectGoal
/// <summary>
/// Gets the usefulness of each subgoal that the Brain
/// currently has and chooses the one with the greatest
/// utility. The utility of a goal is calculated periodically
/// by the Brains update in AI.
/// </summary>
public void SelectGoal()
{
if (canThink == true)
{
best = 0f;
topChoice = null;
for (int i = 0; i <= this.subGoals.Count - 1; i++)
{
//print("GOALS " + i + " " + subGoals[i]);
float utility = subGoals[i].CalculateUtility();
if (utility >= best && utility > 0)
{
best = utility;
topChoice = subGoals[i];
if (!topChoice.Equals(this.myGoal) && this.myGoal != null)
{
this.myGoal.myProperties.myStatus = GoalProps.goalStatus.FAILED;
// this.myGoal.Terminate();
}
}
}
this.myGoal = topChoice;
this.AddSubGoal(this.myGoal);
}
//this.myGoal.Activate();
/*
if (this.myGoal != null)
{
if (this.myGoal != topChoice)
{
this.myGoal.Terminate();
this.myGoal = topChoice;
this.myGoal.Activate();
}
}
else
{
if (subGoals.Count > 0)
{
this.myGoal = topChoice;
this.myGoal.Activate();
}
else
{
this.subGoals.Add(this.GetComponent<Goal_Wander>());
}
}
*/
}
开发者ID:slayer3600,项目名称:sproj,代码行数:63,代码来源:Brain.cs
示例20: TestMethod1
public void TestMethod1()
{
var eventRaised = false;
var sut = new Goal();
sut.PropertyChanged += (s, e) => { eventRaised = true; };
sut.ManDays = 2;
Assert.IsTrue(eventRaised);
}
开发者ID:LeeCampbell,项目名称:PlanGoGo,代码行数:9,代码来源:GoalFixture.cs
注:本文中的Goal类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论