2016-11-04 02:25:53 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2017-07-28 08:28:39 +08:00
|
|
|
|
using System.Reflection;
|
2017-07-31 11:07:07 +08:00
|
|
|
|
using Omegasis.SaveAnywhere.Framework;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
using StardewModdingAPI;
|
|
|
|
|
using StardewModdingAPI.Events;
|
2017-07-28 08:28:39 +08:00
|
|
|
|
using StardewValley;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
using StardewValley.Characters;
|
|
|
|
|
|
2017-07-28 08:28:39 +08:00
|
|
|
|
namespace Omegasis.SaveAnywhere
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/// <summary>The mod entry point.</summary>
|
2017-07-31 05:42:15 +08:00
|
|
|
|
public class SaveAnywhere : Mod
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/*********
|
|
|
|
|
** Properties
|
|
|
|
|
*********/
|
|
|
|
|
/// <summary>Provides methods for saving and loading game data.</summary>
|
2017-07-31 05:57:00 +08:00
|
|
|
|
private SaveManager SaveManager;
|
2017-07-31 10:55:58 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>Provides methods for reading and writing the config file.</summary>
|
2017-07-31 05:57:00 +08:00
|
|
|
|
private ConfigUtilities ConfigUtilities;
|
2017-07-31 05:42:15 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/// <summary>Whether villager schedules should be reset now.</summary>
|
|
|
|
|
private bool ShouldResetSchedules;
|
|
|
|
|
|
|
|
|
|
/// <summary>The parsed schedules by NPC name.</summary>
|
|
|
|
|
private readonly IDictionary<string, string> NpcSchedules = new Dictionary<string, string>();
|
2017-05-14 06:27:24 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
|
|
|
|
|
/*********
|
|
|
|
|
** Public methods
|
|
|
|
|
*********/
|
|
|
|
|
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
|
|
|
|
|
/// <param name="helper">Provides simplified APIs for writing mods.</param>
|
2016-12-09 08:34:28 +08:00
|
|
|
|
public override void Entry(IModHelper helper)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 09:58:48 +08:00
|
|
|
|
this.ConfigUtilities = new ConfigUtilities(this.Helper.DirectoryPath);
|
2017-07-31 05:57:00 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
SaveEvents.AfterLoad += this.SaveEvents_AfterLoad;
|
|
|
|
|
ControlEvents.KeyPressed += this.ControlEvents_KeyPressed;
|
2017-07-31 09:58:48 +08:00
|
|
|
|
GameEvents.UpdateTick += this.GameEvents_UpdateTick;
|
2017-08-06 03:20:46 +08:00
|
|
|
|
TimeEvents.AfterDayStarted += this.TimeEvents_AfterDayStarted;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-05-14 06:27:24 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
|
|
|
|
|
/*********
|
|
|
|
|
** Private methods
|
|
|
|
|
*********/
|
|
|
|
|
/// <summary>The method invoked after the player loads a save.</summary>
|
2017-07-31 09:58:48 +08:00
|
|
|
|
/// <param name="sender">The event sender.</param>
|
|
|
|
|
/// <param name="e">The event data.</param>
|
2017-07-31 10:55:58 +08:00
|
|
|
|
private void SaveEvents_AfterLoad(object sender, EventArgs e)
|
2017-05-14 06:27:24 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// load config
|
|
|
|
|
this.ConfigUtilities.LoadConfig();
|
|
|
|
|
this.ConfigUtilities.WriteConfig();
|
2017-07-31 09:58:48 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// load positions
|
|
|
|
|
this.SaveManager = new SaveManager(Game1.player, this.Helper.DirectoryPath, this.Monitor, this.Helper.Reflection, onVillagersReset: () => this.ShouldResetSchedules = true);
|
|
|
|
|
this.SaveManager.LoadPositions();
|
2017-05-14 06:27:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/// <summary>The method invoked when the game updates (roughly 60 times per second).</summary>
|
|
|
|
|
/// <param name="sender">The event sender.</param>
|
|
|
|
|
/// <param name="e">The event data.</param>
|
|
|
|
|
private void GameEvents_UpdateTick(object sender, EventArgs e)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// let save manager run background logic
|
|
|
|
|
if (Context.IsWorldReady)
|
|
|
|
|
this.SaveManager.Update();
|
|
|
|
|
|
|
|
|
|
// reset NPC schedules
|
|
|
|
|
if (Context.IsWorldReady && this.ShouldResetSchedules)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
this.ShouldResetSchedules = false;
|
|
|
|
|
this.ApplySchedules();
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-06 03:20:46 +08:00
|
|
|
|
/// <summary>The method invoked after a new day starts.</summary>
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/// <param name="sender">The event sender.</param>
|
|
|
|
|
/// <param name="e">The event data.</param>
|
2017-08-06 03:20:46 +08:00
|
|
|
|
private void TimeEvents_AfterDayStarted(object sender, EventArgs e)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// reload NPC schedules
|
|
|
|
|
this.ShouldResetSchedules = true;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// update NPC schedules
|
|
|
|
|
this.NpcSchedules.Clear();
|
|
|
|
|
foreach (NPC npc in Utility.getAllCharacters())
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (!this.NpcSchedules.ContainsKey(npc.name))
|
|
|
|
|
this.NpcSchedules.Add(npc.name, this.ParseSchedule(npc));
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/// <summary>The method invoked when the presses a keyboard button.</summary>
|
|
|
|
|
/// <param name="sender">The event sender.</param>
|
|
|
|
|
/// <param name="e">The event data.</param>
|
|
|
|
|
private void ControlEvents_KeyPressed(object sender, EventArgsKeyPressed e)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-08-06 03:23:10 +08:00
|
|
|
|
if (!Context.IsPlayerFree)
|
2016-12-09 08:34:28 +08:00
|
|
|
|
return;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (e.KeyPressed.ToString() == this.ConfigUtilities.KeyBinding)
|
|
|
|
|
this.SaveManager.SaveGameAndPositions();
|
|
|
|
|
}
|
2017-07-31 05:42:15 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/// <summary>Apply the NPC schedules to each NPC.</summary>
|
|
|
|
|
private void ApplySchedules()
|
|
|
|
|
{
|
|
|
|
|
if (Game1.weatherIcon == Game1.weather_festival || Game1.isFestival() || Game1.eventUp)
|
|
|
|
|
return;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
MethodInfo pathfind = typeof(NPC).GetMethod("pathfindToNextScheduleLocation", BindingFlags.NonPublic | BindingFlags.Instance);
|
2016-11-04 02:25:53 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// apply for each NPC
|
|
|
|
|
foreach (NPC npc in Utility.getAllCharacters())
|
|
|
|
|
{
|
|
|
|
|
if (npc.DirectionsToNewLocation != null || npc.isMoving() || npc.Schedule == null || npc.controller != null || npc is Horse)
|
|
|
|
|
continue;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// get raw schedule from XNBs
|
|
|
|
|
IDictionary<string, string> rawSchedule = this.GetRawSchedule(npc.name);
|
|
|
|
|
if (rawSchedule == null)
|
|
|
|
|
continue;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// get schedule data
|
|
|
|
|
string scheduleData;
|
|
|
|
|
if (!this.NpcSchedules.TryGetValue(npc.name, out scheduleData) || string.IsNullOrEmpty(scheduleData))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
this.Monitor.Log("THIS IS AWKWARD");
|
|
|
|
|
continue;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// get schedule script
|
|
|
|
|
string script;
|
|
|
|
|
if (!rawSchedule.TryGetValue(scheduleData, out script))
|
|
|
|
|
continue;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// parse entries
|
|
|
|
|
string[] entries = script.Split('/');
|
|
|
|
|
int index = 0;
|
|
|
|
|
foreach (string _ in entries)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
string[] fields = entries[index].Split(' ');
|
|
|
|
|
|
|
|
|
|
// handle GOTO command
|
|
|
|
|
if (fields.Contains("GOTO"))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
for (int i = 0; i < fields.Length; i++)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
string s = fields[i];
|
|
|
|
|
if (s == "GOTO")
|
|
|
|
|
{
|
|
|
|
|
rawSchedule.TryGetValue(fields[i + 1], out script);
|
|
|
|
|
string[] newEntries = script.Split('/');
|
|
|
|
|
fields = newEntries[0].Split(' ');
|
|
|
|
|
}
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// parse schedule script
|
2016-11-04 02:25:53 +08:00
|
|
|
|
SchedulePathDescription schedulePathDescription;
|
|
|
|
|
try
|
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (Convert.ToInt32(fields[0]) > Game1.timeOfDay) break;
|
|
|
|
|
string endMap = Convert.ToString(fields[1]);
|
|
|
|
|
int x = Convert.ToInt32(fields[2]);
|
|
|
|
|
int y = Convert.ToInt32(fields[3]);
|
|
|
|
|
int endFacingDir = Convert.ToInt32(fields[4]);
|
|
|
|
|
schedulePathDescription = (SchedulePathDescription)pathfind.Invoke(npc, new object[] { npc.currentLocation.name, npc.getTileX(), npc.getTileY(), endMap, x, y, endFacingDir, null, null });
|
|
|
|
|
index++;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2017-08-04 09:05:48 +08:00
|
|
|
|
//this.Monitor.Log($"Error pathfinding NPC {npc.name}: {ex}", LogLevel.Error);
|
2016-11-04 02:25:53 +08:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
npc.DirectionsToNewLocation = schedulePathDescription;
|
|
|
|
|
npc.controller = new PathFindController(npc.DirectionsToNewLocation.route, npc, Utility.getGameLocationOfCharacter(npc))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
finalFacingDirection = npc.DirectionsToNewLocation.facingDirection,
|
|
|
|
|
endBehaviorFunction = null
|
|
|
|
|
};
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
}
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/// <summary>Get an NPC's raw schedule data from the XNB files.</summary>
|
|
|
|
|
/// <param name="npcName">The NPC name whose schedules to read.</param>
|
|
|
|
|
/// <returns>Returns the NPC schedule if found, else <c>null</c>.</returns>
|
|
|
|
|
private IDictionary<string, string> GetRawSchedule(string npcName)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return Game1.content.Load<Dictionary<string, string>>($"Characters\\schedules\\{npcName}");
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
catch (Exception)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
/// <summary>Load the raw schedule data for an NPC.</summary>
|
|
|
|
|
/// <param name="npc">The NPC whose schedule to read.</param>
|
|
|
|
|
private string ParseSchedule(NPC npc)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// set flags
|
2016-11-04 02:25:53 +08:00
|
|
|
|
if (npc.name.Equals("Robin") || Game1.player.currentUpgrade != null)
|
|
|
|
|
npc.isInvisible = false;
|
|
|
|
|
if (npc.name.Equals("Willy") && Game1.stats.DaysPlayed < 2u)
|
|
|
|
|
npc.isInvisible = true;
|
|
|
|
|
else if (npc.Schedule != null)
|
|
|
|
|
npc.followSchedule = true;
|
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// read schedule data
|
|
|
|
|
IDictionary<string, string> schedule = this.GetRawSchedule(npc.name);
|
|
|
|
|
if (schedule == null)
|
2016-11-04 02:25:53 +08:00
|
|
|
|
return "";
|
2017-07-31 05:42:15 +08:00
|
|
|
|
|
2017-07-31 10:55:58 +08:00
|
|
|
|
// do stuff
|
2016-11-04 02:25:53 +08:00
|
|
|
|
if (npc.isMarried())
|
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
string dayName = Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth);
|
|
|
|
|
if ((npc.name.Equals("Penny") && (dayName.Equals("Tue") || dayName.Equals("Wed") || dayName.Equals("Fri"))) || (npc.name.Equals("Maru") && (dayName.Equals("Tue") || dayName.Equals("Thu"))) || (npc.name.Equals("Harvey") && (dayName.Equals("Tue") || dayName.Equals("Thu"))))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
|
|
|
|
FieldInfo field = typeof(NPC).GetField("nameofTodaysSchedule", BindingFlags.NonPublic | BindingFlags.Instance);
|
|
|
|
|
field.SetValue(npc, "marriageJob");
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return "marriageJob";
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (!Game1.isRaining && schedule.ContainsKey("marriage_" + Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth)))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
|
|
|
|
FieldInfo field = typeof(NPC).GetField("nameofTodaysSchedule", BindingFlags.NonPublic | BindingFlags.Instance);
|
|
|
|
|
field.SetValue(npc, "marriage_" + Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth));
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return "marriage_" + Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth);
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
npc.followSchedule = false;
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey(Game1.currentSeason + "_" + Game1.dayOfMonth))
|
|
|
|
|
return Game1.currentSeason + "_" + Game1.dayOfMonth;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
int i;
|
|
|
|
|
for (i = (Game1.player.friendships.ContainsKey(npc.name) ? (Game1.player.friendships[npc.name][0] / 250) : -1); i > 0; i--)
|
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey(Game1.dayOfMonth + "_" + i))
|
|
|
|
|
return Game1.dayOfMonth + "_" + i;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey(string.Empty + Game1.dayOfMonth))
|
|
|
|
|
return string.Empty + Game1.dayOfMonth;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
if (npc.name.Equals("Pam") && Game1.player.mailReceived.Contains("ccVault"))
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return "bus";
|
2016-11-04 02:25:53 +08:00
|
|
|
|
if (Game1.isRaining)
|
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (Game1.random.NextDouble() < 0.5 && schedule.ContainsKey("rain2"))
|
|
|
|
|
return "rain2";
|
|
|
|
|
if (schedule.ContainsKey("rain"))
|
|
|
|
|
return "rain";
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
List<string> list = new List<string> { Game1.currentSeason, Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth) };
|
2016-11-04 02:25:53 +08:00
|
|
|
|
i = (Game1.player.friendships.ContainsKey(npc.name) ? (Game1.player.friendships[npc.name][0] / 250) : -1);
|
|
|
|
|
while (i > 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add(string.Empty + i);
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey(string.Join("_", list)))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return string.Join("_", list);
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
i--;
|
|
|
|
|
list.RemoveAt(list.Count - 1);
|
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey(string.Join("_", list)))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return string.Join("_", list);
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey(Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth)))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth);
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey(Game1.currentSeason))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return Game1.currentSeason;
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey("spring_" + Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth)))
|
2016-11-04 02:25:53 +08:00
|
|
|
|
{
|
2017-07-31 10:55:58 +08:00
|
|
|
|
return "spring_" + Game1.shortDayNameFromDayOfSeason(Game1.dayOfMonth);
|
2016-11-04 02:25:53 +08:00
|
|
|
|
}
|
|
|
|
|
list.RemoveAt(list.Count - 1);
|
|
|
|
|
list.Add("spring");
|
|
|
|
|
i = (Game1.player.friendships.ContainsKey(npc.name) ? (Game1.player.friendships[npc.name][0] / 250) : -1);
|
|
|
|
|
while (i > 0)
|
|
|
|
|
{
|
|
|
|
|
list.Add(string.Empty + i);
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey(string.Join("_", list)))
|
|
|
|
|
return string.Join("_", list);
|
2016-11-04 02:25:53 +08:00
|
|
|
|
i--;
|
|
|
|
|
list.RemoveAt(list.Count - 1);
|
|
|
|
|
}
|
2017-07-31 10:55:58 +08:00
|
|
|
|
if (schedule.ContainsKey("spring"))
|
|
|
|
|
return "spring";
|
2016-11-04 02:25:53 +08:00
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|