Пример #1
0
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()
Пример #2
0
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()
Пример #3
0
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()
Пример #4
0
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()