예제 #1
0
        L = _orderTopClothingByGlobalSlotList(self.garments)
        if L is None:
            return language.Sentence([heshe, u' is naked.']).vt102(observer)
        return language.Sentence([
            heshe,
            u' is wearing ',
            language.ItemizedList([language.Noun(g.thing).nounPhrase()
                                   for g in L]),
            u'.']).vt102(observer)



createShirt = createCreator(
    (Garment, dict(garmentDescription=u'an undescribed shirt',
                   bulk=2,
                   garmentSlots=[GarmentSlot.CHEST,
                                 GarmentSlot.BACK,
                                 GarmentSlot.RIGHT_ARM,
                                 GarmentSlot.LEFT_ARM])))


createUnderwear = createCreator(
    (Garment, dict(garmentDescription=u'an undescribed pair of underwear',
                   bulk=1,
                   garmentSlots=[GarmentSlot.WAIST])))

createPants = createCreator(
    (Garment, dict(garmentDescription=u'an undescribed pair of pants',
                   bulk=2,
                   garmentSlots=[GarmentSlot.RIGHT_LEG,
                                 GarmentSlot.LEFT_LEG,
예제 #2
0
# -*- test-case-name: imaginary.test.test_create -*-

"""
Imaginary-supplied plugins for simple built-in functionality.
"""

from imaginary.creation import CreationPluginHelper, createCreator

thingPlugin = CreationPluginHelper("thing", createCreator())
예제 #3
0
# -*- test-case-name: imaginary.test.test_create -*-
"""
Imaginary-supplied plugins for simple built-in functionality.
"""

from imaginary.creation import CreationPluginHelper, createCreator

thingPlugin = CreationPluginHelper("thing", createCreator())
예제 #4
0
from imaginary.objects import LightSource
from imaginary.creation import CreationPluginHelper, createCreator

theTorchPlugin = CreationPluginHelper(
    u"torch", createCreator((LightSource, {
        "candelas": 80
    })))
예제 #5
0
from imaginary.objects import LightSource
from imaginary.creation import CreationPluginHelper, createCreator

theTorchPlugin = CreationPluginHelper(
    u"torch", createCreator((LightSource, {"candelas": 80})))
예제 #6
0
 def getType(cls):
     return createCreator((Fruit, {'fresh': True}))
예제 #7
0
    def vt102(self, observer):
        heshe = language.Noun(self.thing).heShe()
        L = _orderTopClothingByGlobalSlotList(self.garments)
        if L is None:
            return language.Sentence([heshe, u' is naked.']).vt102(observer)
        return language.Sentence([
            heshe, u' is wearing ',
            language.ItemizedList(
                [language.Noun(g.thing).nounPhrase() for g in L]), u'.'
        ]).vt102(observer)


createShirt = createCreator(
    (Garment,
     dict(garmentDescription=u'an undescribed shirt',
          bulk=2,
          garmentSlots=[
              GarmentSlot.CHEST, GarmentSlot.BACK, GarmentSlot.RIGHT_ARM,
              GarmentSlot.LEFT_ARM
          ])))

createUnderwear = createCreator(
    (Garment,
     dict(garmentDescription=u'an undescribed pair of underwear',
          bulk=1,
          garmentSlots=[GarmentSlot.WAIST])))

createPants = createCreator(
    (Garment,
     dict(garmentDescription=u'an undescribed pair of pants',
          bulk=2,
          garmentSlots=[
예제 #8
0
                        " onto the ground."]))
                state = self.closed
                self.closed = False
                try:
                    obj.moveTo(self.thing.location)
                finally:
                    self.closed = state
            evt.broadcast()


    def add(self, obj):
        coin = ICoin(obj, None)
        if coin is not None:
            self.coinAdded(coin)
        else:
            return super(VendingMachine, self).add(obj)



def createVendingMachine(store, name, description=u""):
    o = objects.Thing(store=store, name=name, description=description)
    VendingMachine.createFor(o)
    return o



createCoin = createCreator((Quarter, {}))
createVendingMachine = createCreator((VendingMachine, {}))
createQuiche = createCreator()

예제 #9
0
 def getType(cls):
     return createCreator((Fruit, {'fresh': True}))