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


C# Character.Save方法代码示例

本文整理汇总了C#中Character.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Character.Save方法的具体用法?C# Character.Save怎么用?C# Character.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Character的用法示例。


在下文中一共展示了Character.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CommitChanges

 public DataObjectOperationResult CommitChanges(CharacterFormModel postedData)
 {
     Mapper.CreateMap<CharacterFormModel, Character>();
     var character = new Character(Db);
     Mapper.Map<CharacterFormModel, Character>(postedData, character);
     var results = character.Save();
     postedData.Id = character.Id;
     return results;
 }
开发者ID:sympletech,项目名称:RavenDesk,代码行数:9,代码来源:CharacterWorker.cs

示例2: ChangeState

 public void ChangeState(IState newState, Character.NPC Actor)
 {
     if (state != null && newState != null) {
         state.Exit(Actor);
         previousState = state;
         state = newState;
         state.Enter(Actor);
         Actor.Save();
     }
 }
开发者ID:vadian,项目名称:Novus,代码行数:10,代码来源:AI.cs

示例3: Enter

 public void Enter(Character.NPC 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
     actor.Description = "The recently dead carcass of " + actor.FirstName + " is rotting as maggots feast on its entrails.";
     actor.NextAiAction = DateTime.Now.AddMinutes(10).ToUniversalTime();
     actor.Save();
 }
开发者ID:vadian,项目名称:Novus,代码行数:8,代码来源:States.cs

示例4: Execute

 public void Execute(Character.NPC actor, ITrigger trigger = null)
 {
     if (actor.StanceState != CharacterEnums.CharacterStanceState.Laying_unconcious &&
         actor.StanceState != CharacterEnums.CharacterStanceState.Laying_dead &&
         actor.StanceState != CharacterEnums.CharacterStanceState.Decomposing) {
         if (DateTime.Now.ToUniversalTime() > actor.NextAiAction) {//so it's time for this AI state to execute
             string message = "Hey pal, you looking for trouble?";
             if (trigger.MessageOverrideAsString.Count > 0) {
                 message = trigger.MessageOverrideAsString[RandomNumber.GetRandomNumber().NextNumber(0, trigger.MessageOverrideAsString.Count)];
             }
             Commands.CommandParser.ExecuteCommand(actor, "say", message);
         }
     }
     //either way we are not staying in this state, it's just a blip state
     actor.NextAiAction = DateTime.Now.AddSeconds(Extensions.RandomNumber.GetRandomNumber().NextNumber(60, 121)).ToUniversalTime(); //set when we want this action to execute next
     actor.Fsm.RevertState();
     actor.Save();
 }
开发者ID:vadian,项目名称:Novus,代码行数:18,代码来源:States.cs


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