本文整理汇总了C#中IActor.Save方法的典型用法代码示例。如果您正苦于以下问题:C# IActor.Save方法的具体用法?C# IActor.Save怎么用?C# IActor.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IActor
的用法示例。
在下文中一共展示了IActor.Save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeState
public void ChangeState(IState newState, IActor Actor) {
if (state != null && newState != null) {
state.Exit(Actor);
previousState = state;
state = newState;
state.Enter(Actor);
Actor.Save();
}
}
示例2: Execute
public void Execute(IActor actor, ITrigger trigger = null) {
var npc = actor as NPC;
if (npc.StanceState != CharacterStanceState.Laying_unconcious &&
npc.StanceState != CharacterStanceState.Laying_dead &&
npc.StanceState != CharacterStanceState.Decomposing) {
if (DateTime.Now.ToUniversalTime() > ((NPC)actor).NextAiAction) {//so it's time for this AI state to execute
//get the questID and step that we want to process
npc.Quests.Where(q => q.AutoProcessNextStep == true).SingleOrDefault().AutoProcessQuestStep(actor as IActor);
}
}
//either way we are not staying in this state, it's just a blip state
((NPC)actor).NextAiAction = DateTime.Now.AddSeconds(RandomNumber.GetRandomNumber().NextNumber(1, 5)).ToUniversalTime(); //set when we want this action to execute next
((NPC)actor).Fsm.RevertState();
actor.Save();
}
示例3: Enter
public void Enter(IActor actor) {
//ok when we enter this state we will first set the description to the NPC is sitting here rotting,
//then decomposing and finally get rid of him on exit
((NPC)actor).Description = "The recently dead carcass of " + actor.FirstName + " is rotting as maggots feast on its entrails.";
((NPC)actor).NextAiAction = DateTime.Now.AddMinutes(10).ToUniversalTime();
actor.Save();
}