當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。