当前位置: 首页>>代码示例>>C#>>正文


C# IActor.Save方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:jandar78,项目名称:Novus,代码行数:9,代码来源:AI.cs

示例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();
		}
开发者ID:jandar78,项目名称:Novus,代码行数:16,代码来源:States.cs

示例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();
 }
开发者ID:jandar78,项目名称:Novus,代码行数:7,代码来源:States.cs


注:本文中的IActor.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。