예제 #1
0
def create_general_rule_set(*args, **kwargs):
    '''
    Initializes a general rule set from the configured constant rules.
    '''
    if not Rules.objects(_is_constant=True): #@UndefinedVariable
        raise DominionException('Default constant rules are not configured!')
    rules = GeneralRuleSet(*args, **kwargs)
    
    copy_fields(rules, Rules.objects(_is_constant=True)[0]) #@UndefinedVariable
    
    return rules
예제 #2
0
def create_general_rule_set(*args, **kwargs):
    '''
    Initializes a general rule set from the configured constant rules.
    '''
    if not Rules.objects(_is_constant=True):  #@UndefinedVariable
        raise DominionException('Default constant rules are not configured!')
    rules = GeneralRuleSet(*args, **kwargs)

    copy_fields(rules,
                Rules.objects(_is_constant=True)[0])  #@UndefinedVariable

    return rules
예제 #3
0
def create_constant_rules(phase_order=DEFAULT_PHASE_ORDER,
                          card_types=DEFAULT_CARD_TYPES):
    '''
    Creates a set of constant rules.
    '''
    if Rules.objects(_is_constant=True):  #@UndefinedVariable
        raise DominionException(
            '''Constant rules configuration document already exists
            , please check your actions again''')
    else:
        rules = Rules(phase_order=phase_order,
                      card_types=card_types,
                      _is_constant=True)
    return rules
예제 #4
0
def create_constant_rules(phase_order=DEFAULT_PHASE_ORDER, card_types=DEFAULT_CARD_TYPES):
    '''
    Creates a set of constant rules.
    '''
    if Rules.objects(_is_constant=True): #@UndefinedVariable
            raise DominionException('''Constant rules configuration document already exists
            , please check your actions again''')
    else:
        rules = Rules(phase_order=phase_order, card_types=card_types, _is_constant=True)
    return rules