app/managers/PlayerAgentManager.js
//transfer data into serializable object to be sent to local storage
transfer data into serializable object to be sent to local storage
transfer data into serializable object to be sent to local storage
toSerializable() {
    const res = {}
    const agents = {}
    for (const key of this.agents.keys()) {
      agents[key] = this.agents.get(key).toSerializable()
    }
    Object.assign(res, {
      totalWTP: this.totalWTP,
      maxWTP: this.maxWTP,
      minWTP: this.minWTP,
      WTP_reverse_sum: this.WTP_reverse_sum,
      totalDailyDraw: this.totalDailyDraw,
      cards: this.cards,
      day: this.day
    })
    res.agents = agents
    return res
  }
toSerializable ( ) { const res = { } const agents = { } for ( const key of this . agents . keys ( ) ) { agents [ key ] = this . agents . get ( key ) . toSerializable ( ) } Object . assign ( res , { totalWTP : this . totalWTP , maxWTP : this . maxWTP , minWTP : this . minWTP , WTP_reverse_sum : this . WTP_reverse_sum , totalDailyDraw : this . totalDailyDraw , cards : this . cards , day : this . day } ) res . agents = agents return res }
transfer data into serializable object to be sent to local storage
transfer data into serializable object to be sent to local storage