def land_zone(request): LandZone = Container.new( 'LandZone', lambda cls, item: [item.NAME == 'Card', len(cls) < 1, 'Land' in item.types]) assert 'LandZone' in Container.plugins() return LandZone()
def land_zone(request): LandZone = Container.new( 'LandZone', lambda cls, item: [ item.NAME == 'Card', len(cls) < 1, 'Land' in item.types]) assert 'LandZone' in Container.plugins() return LandZone()
db = Database('sqlite:///wtactics.db') # Items Item.from_table( 'Card', db.cards, exclude=('border_color', 'footer')) Item.new( # target is which card it is placed on 'Token', attributes=('owner', 'type_', 'target')) # Containers Zone = Container.new( 'Zone', lambda cls, item: [ item.NAME == 'Card']) for zone in 'Questing', 'Offensive', 'Defensive': Zone.new( '{0}Zone'.format(zone), lambda cls, item: Zone.constraints(cls, item) + [ zone.lower() in item.types]) HeroZone = Zone.new( 'HeroZone', lambda cls, item: Zone.constraints(cls, item) + [ len(cls) == 1]) # register the plugins actions = Action.plugins() containers = Container.plugins() items = Item.plugins()
from vice.plugins import Item, Container, Action from vice.database import Database # opens a local db file db = Database('sqlite:///wtactics.db') # Items Item.from_table('Card', db.cards, exclude=('border_color', 'footer')) Item.new( # target is which card it is placed on 'Token', attributes=('owner', 'type_', 'target')) # Containers Zone = Container.new('Zone', lambda cls, item: [item.NAME == 'Card']) for zone in 'Questing', 'Offensive', 'Defensive': Zone.new( '{0}Zone'.format(zone), lambda cls, item: Zone.constraints(cls, item) + [zone.lower() in item.types]) HeroZone = Zone.new( 'HeroZone', lambda cls, item: Zone.constraints(cls, item) + [len(cls) == 1]) # register the plugins actions = Action.plugins() containers = Container.plugins() items = Item.plugins()