Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

match-maker.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. class ScoreKeeper {
  2. constructor() {}
  3. score(proposer) {
  4. return { ...proposer }
  5. }
  6. }
  7. module.exports = class MatchMaker {
  8. constructor(settings) {
  9. this.proposer = settings.proposer
  10. // Score main profile
  11. this.keeper = new ScoreKeeper()
  12. this.proposer.score = this.keeper.score(this.proposer)
  13. this.profiles = this.getProfilesFor(settings)
  14. }
  15. runPrematch(settings) {
  16. // grab all profiles form the db
  17. // grab all responses
  18. // grab all response keys
  19. // create a full response object
  20. // create a full profile of responses
  21. const unscreenedProfiles = []
  22. const screenedProfiles = []
  23. for (const profile in unscreenedProfiles) {
  24. // Do something here
  25. if (!settings) {
  26. return
  27. }
  28. screenedProfiles.push(profile)
  29. }
  30. return screenedProfiles
  31. }
  32. matchFor(proposer, profiles, settings) {
  33. // Do something here
  34. return this.runPrematch(profiles, settings)
  35. }
  36. scoreProfiles(profiles) {
  37. const matchScores = []
  38. for (const profile in this.profiles) {
  39. const scored = this.keeper.score(profile)
  40. matchScores.push(scored)
  41. }
  42. return matchScores
  43. }
  44. }