コード例 #1
0
        public static void AddEntity(Forcefield e)
        {
            if (buildings.ContainsKey("forcefield"))
            {
                buildings.Remove("forcefield");
            }

            buildings.Add("forcefield", e);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }