コード例 #1
0
    public void SpawnDog()
    {
        AnimalINPC mDog;
        AnimalINPC mDogHelmet;
        AnimalINPC mDogBooties;
        AnimalINPC mDogTreat;
        AnimalINPC mDogBlanket;

        factory = FactoryProducer.GetFactory(FactoryType.Animal);

        mDog        = factory.GetAnimal(AnimalNPCType.WienerDog);
        mDogHelmet  = new SmartHelmetDecorator(factory.GetAnimal(AnimalNPCType.WienerDog));
        mDogBooties = new BootiesDecorator(factory.GetAnimal(AnimalNPCType.WienerDog));
        mDogTreat   = new TreatDecorator(factory.GetAnimal(AnimalNPCType.WienerDog));
        mDogBlanket = new HeatedBlanketDecorator(factory.GetAnimal(AnimalNPCType.WienerDog));
        List <int> mDogstats         = mDog.GetStats();
        List <int> mDogHelmetstats   = mDogHelmet.GetStats();
        List <int> mDogBootiesstats  = mDogBooties.GetStats();
        List <int> mDogTreatstats    = mDogTreat.GetStats();
        List <int> mDogBlanketsstats = mDogBlanket.GetStats();

        Debug.Log("Person Discription, Stats, and Speech: " + mDog.GetDescription() + " | Intel: " + mDogstats[0] + " Strength: " + mDogstats[1] + " | " + mDog.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mDogHelmet.GetDescription() + " | Intel: " + mDogHelmetstats[0] + " Strength: " + mDogHelmetstats[1] + " | " + mDogHelmet.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mDogBooties.GetDescription() + " | Intel: " + mDogBootiesstats[0] + " Strength: " + mDogBootiesstats[1] + " | " + mDogBooties.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mDogTreat.GetDescription() + " | Intel: " + mDogTreatstats[0] + " Strength: " + mDogTreatstats[1] + " | " + mDogTreat.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mDogBlanket.GetDescription() + " | Intel: " + mDogBlanketsstats[0] + " Strength: " + mDogBlanketsstats[1] + " | " + mDogBlanket.Speak());
    }
コード例 #2
0
    public void SpawnHorses()
    {
        AnimalINPC mHorse;
        AnimalINPC mHorseHelmet;
        AnimalINPC mHorseBooties;
        AnimalINPC mHorseTreat;
        AnimalINPC mHorseBlanket;

        factory = FactoryProducer.GetFactory(FactoryType.Animal);

        mHorse        = factory.GetAnimal(AnimalNPCType.Horse);
        mHorseHelmet  = new SmartHelmetDecorator(factory.GetAnimal(AnimalNPCType.Horse));
        mHorseBooties = new BootiesDecorator(factory.GetAnimal(AnimalNPCType.Horse));
        mHorseTreat   = new TreatDecorator(factory.GetAnimal(AnimalNPCType.Horse));
        mHorseBlanket = new HeatedBlanketDecorator(factory.GetAnimal(AnimalNPCType.Horse));
        List <int> mHorsestats         = mHorse.GetStats();
        List <int> mHorseHelmetstats   = mHorseHelmet.GetStats();
        List <int> mHorseBootiesstats  = mHorseBooties.GetStats();
        List <int> mHorseTreatstats    = mHorseTreat.GetStats();
        List <int> mHorseBlanketsstats = mHorseBlanket.GetStats();

        Debug.Log("Person Discription, Stats, and Speech: " + mHorse.GetDescription() + " | Intel: " + mHorsestats[0] + " Strength: " + mHorsestats[1] + " | " + mHorse.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mHorseHelmet.GetDescription() + " | Intel: " + mHorseHelmetstats[0] + " Strength: " + mHorseHelmetstats[1] + " | " + mHorseHelmet.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mHorseBooties.GetDescription() + " | Intel: " + mHorseBootiesstats[0] + " Strength: " + mHorseBootiesstats[1] + " | " + mHorseBooties.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mHorseTreat.GetDescription() + " | Intel: " + mHorseTreatstats[0] + " Strength: " + mHorseTreatstats[1] + " | " + mHorseTreat.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mHorseBlanket.GetDescription() + " | Intel: " + mHorseBlanketsstats[0] + " Strength: " + mHorseBlanketsstats[1] + " | " + mHorseBlanket.Speak());
    }
コード例 #3
0
    public void SpawnBull()
    {
        AnimalINPC mBull;
        AnimalINPC mBullHelmet;
        AnimalINPC mBullBooties;
        AnimalINPC mBullTreat;
        AnimalINPC mBullBlanket;

        factory = FactoryProducer.GetFactory(FactoryType.Animal);

        mBull        = factory.GetAnimal(AnimalNPCType.Bull);
        mBullHelmet  = new SmartHelmetDecorator(factory.GetAnimal(AnimalNPCType.Bull));
        mBullBooties = new BootiesDecorator(factory.GetAnimal(AnimalNPCType.Bull));
        mBullTreat   = new TreatDecorator(factory.GetAnimal(AnimalNPCType.Bull));
        mBullBlanket = new HeatedBlanketDecorator(factory.GetAnimal(AnimalNPCType.Bull));
        List <int> mBullstats         = mBull.GetStats();
        List <int> mBullHelmetstats   = mBullHelmet.GetStats();
        List <int> mBullBootiesstats  = mBullBooties.GetStats();
        List <int> mBullTreatstats    = mBullTreat.GetStats();
        List <int> mBullBlanketsstats = mBullBlanket.GetStats();

        Debug.Log("Person Discription, Stats, and Speech: " + mBull.GetDescription() + " | Intel: " + mBullstats[0] + " Strength: " + mBullstats[1] + " | " + mBull.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mBullHelmet.GetDescription() + " | Intel: " + mBullHelmetstats[0] + " Strength: " + mBullHelmetstats[1] + " | " + mBullHelmet.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mBullBooties.GetDescription() + " | Intel: " + mBullBootiesstats[0] + " Strength: " + mBullBootiesstats[1] + " | " + mBullBooties.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mBullTreat.GetDescription() + " | Intel: " + mBullTreatstats[0] + " Strength: " + mBullTreatstats[1] + " | " + mBullTreat.Speak());
        Debug.Log("Person Discription, Stats, and Speech: " + mBullBlanket.GetDescription() + " | Intel: " + mBullBlanketsstats[0] + " Strength: " + mBullBlanketsstats[1] + " | " + mBullBlanket.Speak());
    }