/// <summary> /// 天気文章をセットする /// /// TODO CtrlTalk:SetWetherSentence アロケーションIDの付け方再考 /// </summary> /// <param name="topic"></param> public void SetWetherSentence(MsgTopic topic) { //NULLチェック if (LiplisStatus.Instance.InfoWether.WetherDtlList == null) { return; } if (LiplisStatus.Instance.InfoWether.WetherDtlList.Count < 1) { return; } if (topic.TalkSentenceList.Count < 1) { return; } //最終センテンス取得 MsgSentence lastSentence = topic.TalkSentenceList[topic.TalkSentenceList.Count - 1]; //現在時刻取得 DateTime dt = DateTime.Now; //天気コード取得 MsgDayWether todayWether = LiplisStatus.Instance.InfoWether.GetWetherSentenceToday(dt); //0~12 今日 午前、午後、夜の天気 if (dt.Hour >= 0 && dt.Hour <= 18) { //次モデル取得 LiplisModel model = LiplisModels.Instance.GetCharacterModelNext(lastSentence.AllocationId); //センテンス生成 LiplisWeather.CreateWetherMessage("今日の天気は", todayWether, topic.TalkSentenceList, model.Tone, model.AllocationId); } //19~23 明日の天気 else if (dt.Hour >= 19 && dt.Hour <= 23) { //明日の天気も取得 MsgDayWether tomorrowWether = LiplisStatus.Instance.InfoWether.GetWetherSentenceTommorow(dt); //次モデル取得 LiplisModel model1 = LiplisModels.Instance.GetCharacterModelNext(lastSentence.AllocationId); //1文目追加 LiplisWeather.CreateWetherMessage("", todayWether, topic.TalkSentenceList, model1.Tone, model1.AllocationId); //次モデル取得 LiplisModel model2 = LiplisModels.Instance.GetCharacterModelNext(model1.AllocationId); //2文目追加 LiplisWeather.CreateWetherMessage("明日の天気は", tomorrowWether, topic.TalkSentenceList, model2.Tone, model2.AllocationId); } }
/// <summary> /// 天気の話題セット /// </summary> /// <returns></returns> public MsgTopic GetWether() { //トピックを生成する MsgTopic topic = new MsgTopic(); //今日は~の日です~ LiplisWeather.SetWetherSentence(topic.TalkSentenceList, Tone, AllocationId); return(topic); }
/// <summary> /// 天気文章をセットする /// /// TODO CtrlTalk:SetWetherSentence アロケーションIDの付け方再考 /// </summary> /// <param name="topic"></param> public void SetWetherSentence(MsgTopic topic) { //NULLチェック if (LiplisStatus.Instance.InfoWether.WetherDtlList == null) { return; } if (LiplisStatus.Instance.InfoWether.WetherDtlList.Count < 1) { return; } //最終センテンス取得 MsgSentence lastSentence = topic.TalkSentenceList[topic.TalkSentenceList.Count - 1]; //モデル LiplisModel cahrData1; LiplisModel cahrData2; LiplisModel cahrData3; //アロケーションID int AllocationId1; int AllocationId2; int AllocationId3; //アロケーションID取得 AllocationId1 = lastSentence.AllocationId + 1; if (AllocationId1 > 3) { AllocationId1 = 0; } AllocationId2 = AllocationId1 + 1; if (AllocationId2 > 3) { AllocationId2 = 0; } AllocationId3 = AllocationId2 + 1; if (AllocationId3 > 3) { AllocationId3 = 0; } //キャラクターデータ取得 cahrData1 = modelController.TableModelId[AllocationId1]; cahrData2 = modelController.TableModelId[AllocationId2]; cahrData3 = modelController.TableModelId[AllocationId3]; //現在時刻取得 DateTime dt = DateTime.Now; //天気コード取得 MsgDayWether todayWether = LiplisStatus.Instance.InfoWether.GetWetherSentenceToday(dt); //0~12 今日 午前、午後、夜の天気 if (dt.Hour >= 0 && dt.Hour <= 18) { LiplisWeather.CreateWetherMessage("今日の天気は", todayWether, topic.TalkSentenceList, cahrData1.Tone, cahrData1.AllocationId); } //19~23 明日の天気 else if (dt.Hour >= 19 && dt.Hour <= 23) { //明日の天気も取得 MsgDayWether tomorrowWether = LiplisStatus.Instance.InfoWether.GetWetherSentenceTommorow(dt); LiplisWeather.CreateWetherMessage("", todayWether, topic.TalkSentenceList, cahrData2.Tone, cahrData2.AllocationId); LiplisWeather.CreateWetherMessage("明日の天気は", tomorrowWether, topic.TalkSentenceList, cahrData3.Tone, cahrData3.AllocationId); } }