Beispiel #1
0
        public Entity CollideFirst(BitTag tag, Vector2 at)
        {
#if DEBUG
            if (Scene == null)
            {
                throw new Exception("Can't collide check an Entity against a tag list when it is not a member of a Scene");
            }
#endif
            return(Collide.First(this, Scene[tag], at));
        }
Beispiel #2
0
        public T CollideFirst <T>(Vector2 at) where T : Entity
        {
#if DEBUG
            if (Scene == null)
            {
                throw new Exception("Can't collide check an Entity against tracked Entities when it is not a member of a Scene");
            }
            else if (!Scene.Tracker.Entities.ContainsKey(typeof(T)))
            {
                throw new Exception("Can't collide check an Entity against an untracked Entity type");
            }
#endif
            return(Collide.First(this, Scene.Tracker.Entities[typeof(T)], at) as T);
        }