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());
            }
        }
Beispiel #2
0
        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);
            });
        }
Beispiel #3
0
 private void RemoveZonePortalsFromList(int zoneId)
 {
     Portals.Where(p => p.Id.ToString().Substring(0, 2) == zoneId.ToString()).ToList().ForEach(x => Portals.Remove(x));
 }