Exemple #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()
Exemple #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()
    def test_creation_from_new(self):
        Deck = Container.new('Deck', lambda cls, item: [
            item.NAME == 'Card',
            40 <= len(cls) <= 60
        ])

        self.assertNotEqual(Deck, None)
Exemple #4
0
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()
Exemple #5
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()