Ejemplo n.º 1
0
        public static void AddEntity(Forcefield e)
        {
            if (buildings.ContainsKey("forcefield"))
            {
                buildings.Remove("forcefield");
            }

            buildings.Add("forcefield", e);
        }
        public static Forcefield CollidesWithForcefield(Entity e)
        {
            if (GameManager.Buildings.ContainsKey("forcefield"))
            {
                Forcefield f = (Forcefield)GameManager.Buildings["forcefield"];
                if (f.Alive && e.Collides(f))
                {
                    return(f);
                }
            }

            return(null);
        }
        public static Forcefield CollidesWithForcefield(Rectangle r)
        {
            if (GameManager.Buildings.ContainsKey("forcefield"))
            {
                Forcefield f = (Forcefield)GameManager.Buildings["forcefield"];
                if (f.Alive && f.Collides(r))
                {
                    return(f);
                }
            }

            return(null);
        }