The frontend/UI server, written in JS using the MarkoJS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
726 B

6 years ago
  1. const {query} = require("../client")
  2. class Character {
  3. /**
  4. * @param {string} id
  5. * @param {string[]} nicks
  6. * @param {string} author
  7. * @param {string} name
  8. * @param {string} shortName
  9. * @param {string} description
  10. */
  11. constructor(id, nicks, author, name, shortName, description) {
  12. this.id = id
  13. this.nicks = nicks
  14. this.nick = this.nicks[0] || null
  15. this.author = author
  16. this.name = name
  17. this.shortName = shortName
  18. this.description = description
  19. }
  20. /**
  21. * Create a character object from data.
  22. */
  23. static fromData(data) {
  24. return new Character(data.id, data.nicks, data.author, data.name, data.shortName, data.description)
  25. }
  26. }
  27. module.exports = { Character }