Example #1
0
        public Entity GetEntity(int id)
        {
            Player ret1;

            if (Players.TryGetValue(id, out ret1))
            {
                return(ret1);
            }
            Enemy ret2;

            if (Enemies.TryGetValue(id, out ret2))
            {
                return(ret2);
            }
            StaticObject ret3;

            if (StaticObjects.TryGetValue(id, out ret3))
            {
                return(ret3);
            }
            ItemEntity ret4;

            if (ItemEntities.TryGetValue(id, out ret4))
            {
                return(ret4);
            }
            return(null);
        }
Example #2
0
        public Entity GetEntity(int id)
        {
            Player ret1;

            if (Players.TryGetValue(id, out ret1))
            {
                return(ret1);
            }
            Enemy ret2;

            if (Enemies.TryGetValue(id, out ret2))
            {
                return(ret2);
            }
            StaticObject ret3;

            return(StaticObjects.TryGetValue(id, out ret3) ? ret3 : null);
        }