import json
from semNets.Topology import Topology
from semNets.Primitives import Node, Relation, RelationAttributeType, RelationType, Attribute


def parseLog(file, parent):
  counter = 0
  current_linenumber = 0
  test = ""
  top = Topology()
  top.setParent(parent)

  #### utilities ####
  utilities = {
  # counters
    "counters" : {
      "friendlyPlayerCounter": 0,
      "hostilePlayerCounter": 0,
      "minionCount": 0,
      "hearthstone_internal_id_count": 0,
      "Location_Friendly_Deck_count": 0,
      "Location_Friendly_Hand_count": 0,
      "Location_Friendly_Board_count": 0,
      "Location_Friendly_Graveyard_count": 0,
      "Location_Hostile_Deck_count": 0,
      "Location_Hostile_Hand_count": 0,
      "Location_Hostile_Board_count": 0,
      "Location_Hostile_Graveyard_count": 0,
      "Location_Friendly_Play_Weapon_count": 0,
      "Location_Hostile_Play_Weapon_count": 0,
      "Location_Hostile_Secrets_count": 0,
      "Location_Friendly_Secrets_count": 0
    },

    # heroes
    "heroes" : {
      "Jaina Proudmoore": "Mage",
      "Rexxar": "Hunter",
      "Uther Lightbringer": "Paladin",
      "Garrosh Hellscream": "Warrior",
      "Malfurion Stormrage": "Druid",
      "Gul'dan": "Warlock",
      "Thrall": "Shaman",
      "Anduin Wrynn": "Priest",
      "Valeera Sanguinar": "Rogue"
    },

    # zones
    "zones" : {
      "FRIENDLY DECK": "Location_Friendly_Deck",
      "FRIENDLY HAND": "Location_Friendly_Hand",
      "FRIENDLY PLAY": "Location_Friendly_Board",
      "FRIENDLY GRAVEYARD": "Location_Friendly_Graveyard",
      "OPPOSING DECK": "Location_Hostile_Deck",
      "OPPOSING HAND": "Location_Hostile_Hand",
      "OPPOSING PLAY": "Location_Hostile_Board",
      "OPPOSING GRAVEYARD": "Location_Hostile_Graveyard",
      "FRIENDLY PLAY (Hero)": "Location_Friendly_Play_Hero",
      "FRIENDLY PLAY (Hero Power)": "Location_Friendly_Play_Hero_Power",