Exemplo n.º 1
0
        public override Entity Create(Point position, Enum id)
        {
            switch ((Mobs)id)
            {
            case Mobs.goomba:
                return(new Goomba(Level, position, CreateSprite((Mobs)id), CreateSquashSprite((Mobs)id)));

            case Mobs.SpinyEgg:
            case Mobs.Spiny:
                return(new Spiny(Level, position, CreateSprite(Mobs.SpinyEgg), CreateSprite(Mobs.Spiny)));

            case Mobs.LakituThrow:
            case Mobs.Lakitu:
                return(new Lakitu(Level, position, CreateSprite(Mobs.Lakitu), CreateSprite(Mobs.LakituThrow)));

            case Mobs.redKoopa:
            case Mobs.greenKoopa:
            case Mobs.GreenFlyingKoopa:
            case Mobs.RedFlyingKoopa:
                Koopa k = Koopa.CreateKoopa(Level, position, (Mobs)id);
                k.States = new StateList <KoopaState, KoopaEnum>(
                    ((Mobs)id == Mobs.GreenFlyingKoopa || (Mobs)id == Mobs.RedFlyingKoopa) ?
                    KoopaEnum.FLYING : KoopaEnum.WALKING,
                    e => koopaStates[e](CreateSprite(id, e), k));
                return(k);

            case Mobs.HammerBro:
                HammerBro h = new HammerBro(Level, position);
                h.BroStates = new StateList <BroState, BroEnum>(BroEnum.WALKING,
                                                                e => broStates[e](CreateSprite(id, e), h));
                return(h);

            case Mobs.PiranhaPlant:
                return(new PiranhaPlant(Level, position, CreateSprite((Mobs)id)));

            case Mobs.BulletBill:
                return(new BulletBill(Level, position, CreateSprite((Mobs)id)));

            case Mobs.SuperBill:
                return(new SuperBill(Level, position, CreateSprite((Mobs)id)));

            case Mobs.FatBill:
                return(new FatBill(Level, position, CreateSprite((Mobs)id)));

            case Mobs.FakeBill:
                return(new FakeBill(Level, position, CreateSprite((Mobs)id)));

            case Mobs.TurboBill:
                return(new TurboBill(Level, position, CreateSprite((Mobs)id)));

            case Mobs.BooHiddn:
                return(new Boo(Level, position, CreateSprite(Mobs.BooHiddn), CreateSprite(Mobs.BooChase)));

            case Mobs.Bowser:
                BowserWeak bowserWeak = new BowserWeak(Level, position);
                bowserWeak.States = new StateList <BowserState, BowserEnum>(BowserEnum.Walking, e => bowserStates[e](CreateSprite(id, e), bowserWeak));
                return(bowserWeak);

            case Mobs.AIBowser:
                AIBowser bowser = new AIBowser(Level, position);
                bowser.States = new StateList <BowserState, BowserEnum>(BowserEnum.Walking, e => bowserStates[e](CreateSprite(id, e), bowser));
                return(bowser);
            }
            return(null);
        }