# Path: MTG/game.py
# class Game(object):
#     def __init__(self, decks, test=False):
#     def timestamp(self):
#     def eot_time(self):
#     def APNAP(self):
#     def opponent(self, player):
#     def apply_to_players(self, func):
#     def add_static_effect(self, name, value, source, toggle_func):
#     def trigger(self, condition, source=None, amount=1):
#     def apply_stack_item(self, stack_item):
#     def apply_to_zone(self, apply_func, _zone, condition=lambda p: True):
#     def apply_to_battlefield(self, apply_func, condition=lambda p: True):
#     def apply_state_based_actions(self):
#         def any_action():
#     def handle_priority(self, step, priority=None):
#     def handle_beginning_phase(self, step):
#     def handle_main_phase(self, step):
#     def handle_combat_phase(self, step):
#     def handle_end_phase(self, step):
#     def handle_turn(self):
#     def print_game_state(self):
#     def setup_game(self):
#     def run_game(self):
# def start_game():
#     GAME = Game(decks)
#     GAME_PREVIOUS_STATE = None
# 
# Path: MTG/cards.py
# SETPREFIX = ['M15', 'sm_set', 'cube']
#     ID = name_to_id(name)
# def id_to_name(ID):
# def name_to_id(name):
# def str_to_class(str):
# def card_from_name(name, get_instance=True):
# def read_deck(filename):
# def add_activated_ability(cardname, cost, effect, target_criterias=None, prompts=None):
# def add_targets(cardname, criterias=[lambda self, p: True], prompts=None):
# def add_play_func_with_targets(cardname, outcome=lambda self, t, l: True):
#     def play_func(self):
# def add_play_func_no_target(cardname, outcome=lambda self: True):
# def add_aura_effect(cardname, effects, target_criterias=['creature']):
# def add_trigger(cardname, condition, effect, requirements=None,
#                 target_criterias=None, target_prompts=None, intervening_if=None):
# def add_static_effect(cardname, apply_to, name, value, toggle_func=lambda eff: False):
# def indentation_lv(s):
# def parse_card_from_lines(lines, log=None):
# def setup_cards(FILES=['data/m15_cards.txt', 'data/cube_cards.txt']):
# 
# Path: MTG/permanent.py
# class Status():
# class Effect():
# class Permanent(gameobject.GameObject):
# class Aura(Permanent):
#     def __init__(self):
#     def __repr__(self):
#     def __str__(self):
#     def reset(self):
#     def __init__(self, value, timestamp, apply_target=None, source=None, expiration=math.inf, is_active=True,
#                  toggle_func=lambda eff: False):
#     def __init__(self, characteristics, controller, owner=None, original_card=None,
#                  status=None, modifications=[]):
#     def __repr__(self):
#     def __str__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def activate_ability(self, num=0):
#     def add_effect(self, name, value, source=None, expiration=math.inf,
#                    is_active=True, toggle_func=lambda eff: True):
#     def get_effect(self, name):
#     def check_effect_expiration(self):
#     def tap(self):
#     def untap(self):
#     def freeze(self):
#     def power(self):
#     def toughness(self):
#     def add_counter(self, counter="+1/+1", num=1):
#     def num_counters(self, counter):
#     def _calculate_pt(self):
#     def is_summoning_sick(self):
#     def can_attack(self):
#     def can_block(self, attackers=None):
#     def attacks(self, player):
#     def blocks(self, creature):
#     def in_combat(self):
#     def exits_combat(self):
#     def take_damage(self, source, dmg, is_combat=False):
#     def deals_damage(self, target, dmg, is_combat=False):
#     def trigger(self, condition, source=None, amount=1):
#     def change_zone(self, target_zone, from_top=0, shuffle=True,
#                     status_mod=None, modi_func=None):
#     def dies(self):
#     def destroy(self):
#     def sacrifice(self):
#     def exile(self):
#     def bounce(self):
#     def flicker(self):
#     def __init__(self, enchant_target, characteristics, controller, owner=None, original_card=None):
#     def enchant(self, target):
#     def disenchant(self):
#     def add_ability(self, ability):
#     def add_pt(self, PT):
# def make_permanent(card, status_mod=None, modi_func=None):
# def make_aura(card, enchant_target):


import mock
import unittest
import time
from MTG import game
from MTG import cards
from MTG import permanent
from MTG.exceptions import *
# from copy import deepcopy


# test cases will fail if this is run
# inside setUpClass, b/c cards get set up multiple times
cards.setup_cards()

class TestGameBase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.f = open('test_game_time.log', 'w')

    @classmethod
    def tearDownClass(cls):
        cls.f.close()

    def setUp(self):
        self.startTime = time.time()
        decks = [cards.read_deck('data/decks/deck1.txt'),

# Path: MTG/game.py
# class Game(object):
#     def __init__(self, decks, test=False):
#     def timestamp(self):
#     def eot_time(self):
#     def APNAP(self):
#     def opponent(self, player):
#     def apply_to_players(self, func):
#     def add_static_effect(self, name, value, source, toggle_func):
#     def trigger(self, condition, source=None, amount=1):
#     def apply_stack_item(self, stack_item):
#     def apply_to_zone(self, apply_func, _zone, condition=lambda p: True):
#     def apply_to_battlefield(self, apply_func, condition=lambda p: True):
#     def apply_state_based_actions(self):
#         def any_action():
#     def handle_priority(self, step, priority=None):
#     def handle_beginning_phase(self, step):
#     def handle_main_phase(self, step):
#     def handle_combat_phase(self, step):
#     def handle_end_phase(self, step):
#     def handle_turn(self):
#     def print_game_state(self):
#     def setup_game(self):
#     def run_game(self):
# def start_game():
#     GAME = Game(decks)
#     GAME_PREVIOUS_STATE = None
# 
# Path: MTG/cards.py
# SETPREFIX = ['M15', 'sm_set', 'cube']
#     ID = name_to_id(name)
# def id_to_name(ID):
# def name_to_id(name):
# def str_to_class(str):
# def card_from_name(name, get_instance=True):
# def read_deck(filename):
# def add_activated_ability(cardname, cost, effect, target_criterias=None, prompts=None):
# def add_targets(cardname, criterias=[lambda self, p: True], prompts=None):
# def add_play_func_with_targets(cardname, outcome=lambda self, t, l: True):
#     def play_func(self):
# def add_play_func_no_target(cardname, outcome=lambda self: True):
# def add_aura_effect(cardname, effects, target_criterias=['creature']):
# def add_trigger(cardname, condition, effect, requirements=None,
#                 target_criterias=None, target_prompts=None, intervening_if=None):
# def add_static_effect(cardname, apply_to, name, value, toggle_func=lambda eff: False):
# def indentation_lv(s):
# def parse_card_from_lines(lines, log=None):
# def setup_cards(FILES=['data/m15_cards.txt', 'data/cube_cards.txt']):
# 
# Path: MTG/permanent.py
# class Status():
# class Effect():
# class Permanent(gameobject.GameObject):
# class Aura(Permanent):
#     def __init__(self):
#     def __repr__(self):
#     def __str__(self):
#     def reset(self):
#     def __init__(self, value, timestamp, apply_target=None, source=None, expiration=math.inf, is_active=True,
#                  toggle_func=lambda eff: False):
#     def __init__(self, characteristics, controller, owner=None, original_card=None,
#                  status=None, modifications=[]):
#     def __repr__(self):
#     def __str__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __hash__(self):
#     def activate_ability(self, num=0):
#     def add_effect(self, name, value, source=None, expiration=math.inf,
#                    is_active=True, toggle_func=lambda eff: True):
#     def get_effect(self, name):
#     def check_effect_expiration(self):
#     def tap(self):
#     def untap(self):
#     def freeze(self):
#     def power(self):
#     def toughness(self):
#     def add_counter(self, counter="+1/+1", num=1):
#     def num_counters(self, counter):
#     def _calculate_pt(self):
#     def is_summoning_sick(self):
#     def can_attack(self):
#     def can_block(self, attackers=None):
#     def attacks(self, player):
#     def blocks(self, creature):
#     def in_combat(self):
#     def exits_combat(self):
#     def take_damage(self, source, dmg, is_combat=False):
#     def deals_damage(self, target, dmg, is_combat=False):
#     def trigger(self, condition, source=None, amount=1):
#     def change_zone(self, target_zone, from_top=0, shuffle=True,
#                     status_mod=None, modi_func=None):
#     def dies(self):
#     def destroy(self):
#     def sacrifice(self):
#     def exile(self):
#     def bounce(self):
#     def flicker(self):
#     def __init__(self, enchant_target, characteristics, controller, owner=None, original_card=None):
#     def enchant(self, target):
#     def disenchant(self):
#     def add_ability(self, ability):
#     def add_pt(self, PT):
# def make_permanent(card, status_mod=None, modi_func=None):
# def make_aura(card, enchant_target):


# Path: MTG/test/test_game.py
import mock
import unittest
import time
from MTG import game
from MTG import cards
from MTG import permanent
from MTG.exceptions import *

# from copy import deepcopy


# test cases will fail if this is run
# inside setUpClass, b/c cards get set up multiple times
cards.setup_cards()

class TestGameBase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.f = open('test_game_time.log', 'w')

    @classmethod
    def tearDownClass(cls):
        cls.f.close()

    def setUp(self):
        self.startTime = time.time()
        decks = [cards.read_deck('data/decks/deck1.txt'),

                 cards.read_deck('data/decks/deck1.txt')]