Exemplo n.º 1
0
        }    /**
              * Will Create BaseEnemy that this Representative will represent
              * @return
              */

        protected bool setType(InteractableObject.ObjectType newType)
        {
            if (newType != null)
            {
                type = newType;
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        /**
         * Will create the BaseEnemy object associated with the given Enemy type
         * @param newType The Type of BaseEnemy requested
         * @return The new BseEnemy
         */
        internal static BaseEnemy createEnemy(InteractableObject.ObjectType newType)
        {
            BaseEnemy retVal = null;

            switch (newType)
            {
            case InteractableObject.ObjectType.ANGRY: {
                retVal = new Ghost(BaseCode.activeLibrary);     //Creating Ghost
                ((Ghost)retVal).MakeAngry();                    //Angering Ghost
                break;
            }

            case InteractableObject.ObjectType.GHOST: {
                retVal = (new Ghost(BaseCode.activeLibrary));
                break;
            }

            case InteractableObject.ObjectType.SPIDER: {
                retVal = (new Spider(BaseCode.activeLibrary));
                break;
            }

            case InteractableObject.ObjectType.VAMPIRE: {
                retVal = (new Vampire(BaseCode.activeLibrary));
                break;
            }

            case InteractableObject.ObjectType.MUMMY: {
                retVal = (new Mummy(BaseCode.activeLibrary));
                break;
            }

            case InteractableObject.ObjectType.PUMPKIN: {
                retVal = (new Pumpkin(BaseCode.activeLibrary));
                break;
            }

            case InteractableObject.ObjectType.ZOMBIE: {
                retVal = (new Zombie(BaseCode.activeLibrary));
                break;
            }

            case InteractableObject.ObjectType.FRANKENSTEIN: {
                retVal = (new Frankenstein(BaseCode.activeLibrary));
                break;
            }

            case InteractableObject.ObjectType.CAT: {
                retVal = (new Cat(BaseCode.activeLibrary));
                break;
            }
            }
            return(retVal);
        }