/// <summary>
        /// Creates a new invader according to the given invader data
        /// </summary>
        /// <param name="i_InvaderType">The invader type that we want to
        /// create</param>
        /// <param name="i_Game">The game component needed for the invader 
        /// creation</param>
        /// <param name="i_UpdateOrder">The invader update order</param>
        /// <param name="i_InvaderListNum">The invader list number in the
        /// invaders matrix</param>
        /// <returns></returns>
        public Invader CreateInvader(
            eInvadersType i_InvaderType,
            Game i_Game,
            int i_UpdateOrder,
            int i_InvaderListNum)
        {
            Invader retVal = null;

            switch (i_InvaderType)
            {
                case eInvadersType.YellowInvader:
                    retVal = new YellowInvader(
                        i_Game,
                        i_UpdateOrder,
                        i_InvaderListNum);
                    break;
                case eInvadersType.BlueInvader:
                    retVal = new BlueInvader(
                        i_Game,
                        i_UpdateOrder,
                        i_InvaderListNum);
                    break;
                case eInvadersType.PinkInvader:
                    retVal = new PinkInvader(
                        i_Game,
                        i_UpdateOrder,
                        i_InvaderListNum);
                    break;
            }

            return retVal;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Return an invader score according to the current level data
        /// </summary>
        /// <param name="i_Invader">The invader we want to get his score</param>
        /// <returns>The score of the invader in the current level</returns>
        public int GetInvaderScore(eInvadersType i_Invader)
        {
            int retVal;

            m_InvadersScoreMap.TryGetValue(i_Invader, out retVal);

            return retVal;
        }