Пример #1
0
 def select_from_object(cls, obj, replay):
     return db.session.query(cls).filter(
                 and_(
                          cls.__INFO__==INFO.select_from_object(replay).__id__,
                          cls.id==obj.id
                     )
             ).one_or_none()
Пример #2
0
    def process_dependancies(cls, obj, replay):
        info = None if not replay else INFO.select_from_object(replay)
        player = None if not obj.player else PLAYER.select_from_object(obj.player, replay)

        return {
                    'info' : info,
                    'player' : player,
               }
Пример #3
0
    def process_dependancies(cls, obj, replay):
        info = None if not replay else INFO.select_from_object(replay)
        unit_controller = None if not obj.unit_controller else PLAYER.select_from_object(
            obj.unit_controller, replay)
        unit = None if not obj.unit else OBJECT.select_from_object(
            obj.unit, replay)

        return {'info': info, 'unit_controller': unit_controller, 'unit': unit}
Пример #4
0
    def process_dependancies(cls, obj, replay):
        info = None if not replay else INFO.select_from_object(replay)
        player = None if not obj.player else PLAYER.select_from_object(
            obj.player, replay)
        ability = None if not obj.ability else ABILITY.select_from_object(
            obj.ability, replay)

        return {'info': info, 'player': player, 'ability': ability}
Пример #5
0
    def select_from_object(cls, obj, replay):
        NULLPLAYER = namedtuple('NULLPLAYER', ('detail_data', ))
        obj = obj if obj else NULLPLAYER({'bnet': {'uid': -1}})
        return db.session.query(cls).filter(
            and_(cls.id == obj.detail_data['bnet']['uid'], cls.__INFO__ ==
                 INFO.select_from_object(replay).__id__)).one_or_none()

        pass
Пример #6
0
    def process_dependancies(cls, obj, replay):
        info = None if not replay else INFO.select_from_object(replay)
        unit = None if not obj.unit else OBJECT.select_from_object(obj.unit, replay)
        unit_type = None if not obj.unit_type_name else UNIT_TYPE.select_from_str_id(obj.unit_type_name, replay)

        return {
                    'info' : info,
                    'unit' : unit,
                    'unit_type' : unit_type
               }
Пример #7
0
 def process_dependancies(cls, obj, replay):
     info = None if not replay else INFO.select_from_object(replay)
     return {
                 'info' : info,
            }
Пример #8
0
 def process_dependancies(cls, replay):
     UT = None if not replay else INFO.select_from_object(replay)
     return {'replay': UT, '__INFO__': None if UT else UT.__id__}
Пример #9
0
 def process(cls, replay):
     MAP.process(replay)
     INFO.process(replay)
     PLAYER.process(replay)
     OBJECT.process(replay)
Пример #10
0
    def process_dependancies(cls, _unit, replay):
        info = None if not replay else INFO.select_from_object(replay)
        unit = None if not _unit else OBJECT.select_from_object(_unit, replay)

        return {'info': info, 'unit': unit}
Пример #11
0
action = args.action

if action == 'db':
    home = '/Users/jacob/Library/Application Support/Blizzard/StarCraft II/Accounts/91611726/1-S2-1-4635037/Replays/Multiplayer/'
    sc2Replays = listdir(home)

    for r in sc2Replays:
        if r != '.DS_Store':
            try:
                replay = sc2reader.load_replay(home + r, load_level=1)
                print(r)
            except Exception as e:
                print(e)
                continue
            if INFO.process_conditions(replay):
                print(r)
                try:
                    replay = sc2reader.load_replay(home + r,
                                                   load_level=5,
                                                   load_map=True)
                    inject = INJECT(replay).__construct__()
                except Exception as e:
                    print(e)

elif action == 'app':
    from src.app.index import *

elif action == 'explore':
    events = {}
    replay = sc2reader.load_replay('example.SC2Replay',