예제 #1
0
파일: Entity.cs 프로젝트: aaronlws95/twog
        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));
        }
예제 #2
0
파일: Entity.cs 프로젝트: aaronlws95/twog
        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);
        }