private void AddNewLookupLocation(LocationList location) { var feedeeLocationTable = new Dictionary <string, FeedeeEntry>(); nodeFeedeeLookup = new Dictionary <TownNodeList, SaveableClone>(); saveableClones = new List <SaveableClone>(); foreach (TownNodeList townNode in nodeManager.GetLocationMainNodes(location)) { for (int i = 0; i < nodeManager.GetNodeMenuCount(location, townNode); i++) { if (nodeManager.HasNPCSpawn(location, townNode, i)) { TownNodeList feedeeNode = nodeManager.GetConnectedNode(location, townNode, i); FeedeeClass newFeedeeClass = ChooseFeedeeClass(feedeeNode); FeedeeEntry newFeedee = CreateNewFeedee(newFeedeeClass, feedeeNode); SaveableClone feedeeSaveable = feedeeSpawner.SpawnNewNPC(newFeedee.feedeeClass, newFeedee.identifier); NPCInfo info = feedeeSaveable.GetComponent <NPCInfo>(); info.SetCharacterInfo("name", newFeedee.name); info.SetCharacterInfo("rank", newFeedeeClass.ToString()); saveableClones.Add(feedeeSaveable); feedeeLocationTable[newFeedee.identifier] = newFeedee; AssignNPCToNode(feedeeSaveable, feedeeNode); } } feedeeLookup[location] = feedeeLocationTable; } }
private FeedeeEntry CreateNewFeedee(FeedeeClass newClass, TownNodeList node = TownNodeList.None) { BuildLookup(); FeedeeEntry newFeedee = new FeedeeEntry(); SaveableEntity saveable = GetComponent <SaveableEntity>(); newFeedee.feedeeClass = newClass; newFeedee.activeNode = node; newFeedee.identifier = saveable.GenerateNewUniqueIdentifier(""); newFeedee.name = newFeedee.identifier; return(newFeedee); }