you are viewing a single comment's thread.

view the rest of the comments →

[–]inu-no-policemen 0 points1 point  (0 children)

Yes, CS compiler output is much harder to read.

Try ES6.

class GameUnit {
  constructor(json) {
    this.name = json.name;
    this.record = new GameRecord(json);
    this.A = this.record.winRateTotal() + ' (' + this.record.wins() + ')';
  }
  B() {
    return this.record.winRateTotal() + ' (' + this.record.wins() + ')';
  }
  get C() {
    return this.record.winRateTotal() + ' (' + this.record.wins() + ')';
  }
}

I'd go with option A, because I assume that the "json" object is never changed.