<commit_before>class SmallDesk extends Entity
  modelName: -> 'small_desk'

  agent: 0

  constructor: (@x, @y)->
    super(@x, @y)



  empty: () ->
    @agent = null

  assignDesk: (@agent) ->

  getAgents: () ->
    return Agent.getPotentialAgents()

  hireScreen: () ->
    ui = Game.state.ui
    agents = @getAgents()
    title = "Hire New Agent"
    hireButtons = []
    content = "Click the Button "
    me = this

    for agent in agents
      console.log(agent.name)
      name = agent.name
      email =  agent.skills.email
      phoneSkill =  agent.skills.phone
      salary =  agent.salary
      agentTx = agent.name + "\ne: " + email  + "\np: " +  phoneSkill + "\nsalary: " +  salary.toFixed(2)

      buttonClick = (agent_) ->
        ui.close()
        me.hireAgent(agent_)
      button = {text: agentTx, click: $.proxy(buttonClick, this, agent)}
      hireButtons.push(button)

    ui.changeTitle(title)
    ui.changeContent(content)
    ui.changeButtons(hireButtons)
    ui.open()

  hireAgent: (agentD) ->
    @agent = new Agent(this.x, this.y+1, agentD)
    Agent.potentialAgents.pop()

  infoScreen: () ->
    ui = Game.state.ui

    if(!@agent)

    else
      title = @agent.name
      content = "Skills: email - " + @agent.skills.email + " | phone - " + @agent.skills.phone


      ui.changeTitle(title)
      ui.changeContent(content)
      ui.changeButtons("")
      ui.open()


  assignScreen: () ->
    console.log("assign this agent to something")
    ui = Game.state.ui
    title = "Assign to Queue"
    email_queue = Game.state.requestQueues.email
    phone_queue = Game.state.requestQueues.phone
    me = this
    buttonEmailClick = ->
      me.agent.assign(email_queue)
      ui.close()
    buttonPhoneClick = ->
      me.agent.assign(phone_queue)
      ui.close()<commit_msg>Don't hire same agent twice<commit_after>class SmallDesk extends Entity
  modelName: -> 'small_desk'

  agent: 0

  constructor: (@x, @y)->
    super(@x, @y)



  empty: () ->
    @agent = null

  assignDesk: (@agent) ->

  getAgents: () ->
    return Agent.getPotentialAgents()

  hireScreen: () ->
    ui = Game.state.ui
    agents = @getAgents()
    title = "Hire New Agent"
    hireButtons = []
    content = "Click the Button "
    me = this

    for agent in agents
      console.log(agent.name)
      name = agent.name
      email =  agent.skills.email
      phoneSkill =  agent.skills.phone
      salary =  agent.salary
      agentTx = agent.name + "\ne: " + email  + "\np: " +  phoneSkill + "\nsalary: " +  salary.toFixed(2)

      buttonClick = (agent_) ->
        ui.close()
        me.hireAgent(agent_)
      button = {text: agentTx, click: $.proxy(buttonClick, this, agent)}
      hireButtons.push(button)

    ui.changeTitle(title)
    ui.changeContent(content)
    ui.changeButtons(hireButtons)
    ui.open()

  hireAgent: (agentD) ->
    @agent = new Agent(this.x, this.y+1, agentD)
    Agent.potentialAgents = Agent.potentialAgents.filter((agent) ->
      agent != agentD
    )

  infoScreen: () ->
    ui = Game.state.ui

    if(!@agent)

    else
      title = @agent.name
      content = "Skills: email - " + @agent.skills.email + " | phone - " + @agent.skills.phone


      ui.changeTitle(title)
      ui.changeContent(content)
      ui.changeButtons("")
      ui.open()


  assignScreen: () ->
    console.log("assign this agent to something")
    ui = Game.state.ui
    title = "Assign to Queue"
    email_queue = Game.state.requestQueues.email
    phone_queue = Game.state.requestQueues.phone
    me = this
    buttonEmailClick = ->
      me.agent.assign(email_queue)
      ui.close()
    buttonPhoneClick = ->
      me.agent.assign(phone_queue)
      ui.close()
{'fraction_non_alphanumeric': 0.13779101245262587, 'fraction_numerical': 0.0016242555495397943, 'mean_word_length': 2.3836996336996337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5767843', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1229, 'n_words': 252}