public override bool Equals(object obj)
        {
            GameObjectPlace newObj = obj as GameObjectPlace;

            if (newObj != null && this.XCordinate == newObj.XCordinate && this.YCordinat == newObj.YCordinat)
            {
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// Make a AlianShip
        /// </summary>
        /// <param name="objectPlace"></param>
        /// <returns></returns>
        public override GameObject GetGameObject(GameObjectPlace objectPlace)
        {
            GameObject alianship = new AlianShip()
            {
                Figure          = GameSettings.AlienShip,
                GameObjectPlace = objectPlace,
                gameObjectTipe  = GameObjectTipe.AlianShip
            };

            return(alianship);
        }
        /// <summary>
        /// Make a AlianShip
        /// </summary>
        /// <param name="objectPlace"></param>
        /// <returns></returns>
        public override GameObject GetGameObject(GameObjectPlace objectPlace)
        {
            GroundObject groundObject = new GroundObject()
            {
                Figure          = GameSettings.Ground,
                GameObjectPlace = objectPlace,
                gameObjectTipe  = GameObjectTipe.GroundObject
            };

            return(groundObject);
        }
示例#4
0
        public GameObject GetGameObject()
        {
            GameObjectPlace gameObjectPlace = new GameObjectPlace()
            {
                XCordinate = GameSettings.PlayerShipStartXCordinat,
                YCordinat  = GameSettings.PlayerShipStartYCordinat
            };
            GameObject gameObject = GetGameObject(gameObjectPlace);

            return(gameObject);
        }
示例#5
0
        public override GameObject GetGameObject(GameObjectPlace objectPlace)
        {
            GameObject gameObject = new PlayerShip()
            {
                Figure          = GameSettings.PlayerShip,
                GameObjectPlace = objectPlace,
                gameObjectTipe  = GameObjectTipe.PlayerShip
            };

            return(gameObject);
        }
        public override GameObject GetGameObject(GameObjectPlace objectPlace)
        {
            GameObjectPlace missilePlace = new GameObjectPlace()
            {
                XCordinate = objectPlace.XCordinate,
                YCordinat  = objectPlace.YCordinat - 1,
            };
            GameObject missile = new PlayerShipMissile()
            {
                Figure          = GameSettings.PlayerMissile,
                GameObjectPlace = missilePlace,
                gameObjectTipe  = GameObjectTipe.PlayerShipMissile
            };

            return(missile);
        }
        public List <GameObject> GetSwarm()
        {
            List <GameObject> swarm = new List <GameObject>();
            int startX = GameSettings.SwarmStartXCordinat;
            int startY = GameSettings.SwarmStartYCordinat;

            for (int y = 0; y < GameSettings.NumbersOfSwarmsRows; y++)
            {
                for (int x = 0; x < GameSettings.NumbersOfSwarmColls; x++)
                {
                    GameObjectPlace objectPlace = new GameObjectPlace()
                    {
                        XCordinate = startX + x, YCordinat = startY + y
                    };
                    GameObject alienShip = GetGameObject(objectPlace);
                    swarm.Add(alienShip);
                }
            }

            return(swarm);
        }
        public List <GameObject> GetGround()
        {
            List <GameObject> ground = new List <GameObject>();
            int startX = GameSettings.GroundStartXCordinat;
            int startY = GameSettings.GroundStartYCordinat;

            for (int y = 0; y < GameSettings.NumbersOfGroundRows; y++)
            {
                for (int x = 0; x < GameSettings.NumbersOfGroundColls; x++)
                {
                    GameObjectPlace objectPlace = new GameObjectPlace()
                    {
                        XCordinate = startX + x, YCordinat = startY + y
                    };
                    GameObject groundObject = GetGameObject(objectPlace);
                    ground.Add(groundObject);
                }
            }

            return(ground);
        }
 public abstract GameObject GetGameObject(GameObjectPlace objectPlace);