public void Store(PlayerEventModel playerEventModel) { var entry = this.GetEntry(playerEventModel.Id); if (entry != null) { var index = this.entrys.IndexOf(entry); this.entrys[index] = new PlayerEventEntry() { Id = playerEventModel.Id, EventId = playerEventModel.EventModel.Id, EventState = playerEventModel.EventState.ToString(), doneEventConditionIds = playerEventModel.doneEventConditionModels.Select(model => model.Id).ToArray() }; } else { this.entrys.Add(new PlayerEventEntry() { Id = playerEventModel.Id, EventId = playerEventModel.EventModel.Id, EventState = playerEventModel.EventState.ToString(), doneEventConditionIds = playerEventModel.doneEventConditionModels.Select(model => model.Id).ToArray() }); } PlayerContextMap.WriteEntry(this.entrys); }
public static IEventContents Generate(PlayerEventModel playerEventModel) { if (playerEventModel.EventModel.EventContentsModel.EventContentsType == EventContentsType.Nope) { return(new NL.EventContents.Nope(playerEventModel)); } if (playerEventModel.EventModel.EventContentsModel.EventContentsType == EventContentsType.ForceConversation) { return(new NL.EventContents.ForceConversation(playerEventModel)); } if (playerEventModel.EventModel.EventContentsModel.EventContentsType == EventContentsType.AppearConversationCharacter) { return(new NL.EventContents.AppearConversationCharacter(playerEventModel)); } if (playerEventModel.EventModel.EventContentsModel.EventContentsType == EventContentsType.AppearConversationCharacterNormal) { return(new NL.EventContents.AppearConversationCharacterNormal(playerEventModel)); } if (playerEventModel.EventModel.EventContentsModel.EventContentsType == EventContentsType.ScreenImages) { return(new NL.EventContents.ScreenImages(playerEventModel)); } Debug.Assert(false, "Invalidなコンテンツが生成されました。"); return(new NL.EventContents.Invalid()); }
public RewardReceiver(PlayerEventModel playerEventModel) { this.rewardModel = playerEventModel.EventModel.RewardModel; }