private GameObject FindPortal(string noun, string adjective) { var matchingPortals = Portals.Where(m => m.Noun == noun); if (adjective != "") { return(matchingPortals.FirstOrDefault(i => i.Adjective == adjective)); } else { return(matchingPortals.FirstOrDefault()); } }
private void LoadBarriers() { Portals.Where(x => x.Barrier.IsNotNull()).ToList().ForEach(portal => { var obj = EntityManager.Create <Barrier>(portal.Barrier.ID, portal.Barrier.DisplayName, portal.Barrier); if (obj.IsNull()) { throw new InstantiationException("Barrier {0} could not be instantiated.", portal.Barrier.ID); } obj.OnInit(InitializationAtom); Barriers.Add(portal.ID, obj); }); }
private void RemoveZonePortalsFromList(int zoneId) { Portals.Where(p => p.Id.ToString().Substring(0, 2) == zoneId.ToString()).ToList().ForEach(x => Portals.Remove(x)); }