Task.js 1.57 KB
Newer Older
Alexander Bazo committed
1 2 3
/* eslint-env node */

const schema = require("@colyseus/schema"),
Alexander Bazo committed
4 5 6 7 8
  Schema = schema.Schema,
  TASKS = [{
    imageUrl: "images/Brueghel-The_Dutch_Proverbs.jpg",
    taskDescription: "Suchen Sie nach bildlichen Darstellungen niederländischer Sprichwörter des 16. Jahrhunderts.",
    taskSource: "Pieter Bruegel the Elder, Netherlandish Proverbs (Oil on oak wood, 1599), Gemäldegalerie, Berlin",
9
    duration: 30000,
Alexander Bazo committed
10 11 12 13 14
  },
  {
    imageUrl: "images/Brueghel-The_Fight_Between_Carnival_and_Lent.jpg",
    taskDescription: "Suchen Sie nach Darstellungen von Personen ohne Kopfbedeckung.",
    taskSource: "Pieter Bruegel the Elder, The Fight Between Carnival and Lent (Oil on oak wood, 1559), Kunsthistorisches Museum, Vienna",
15
    duration: 30000,
Alexander Bazo committed
16 17
  },
  {
Alexander Bazo committed
18
    imageUrl: "images/Bruegel-Childrens_Games.jpg",
Alexander Bazo committed
19 20
    taskDescription: "Identifizieren Sie unterschiedliche Spiele.",
    taskSource: "Pieter Bruegel the Elder, Children's Bruegel-Childrens_Games (Oil on oak wood, 1560), Kunsthistorisches Museum, Vienna",
21
    duration: 30000,
Alexander Bazo committed
22
  }];
Alexander Bazo committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36

var taskCounter = 0;

class Task extends Schema {

  constructor(imageUrl, taskDescription, taskSource, duration) {
    super();
    taskCounter++;
    this.imageUrl = imageUrl;
    this.taskDescription = taskDescription;
    this.taskSource = taskSource;
    this.duration = duration;
    this.position = taskCounter;
  }
Alexander Bazo committed
37 38 39 40

  static getTasks() {
    return TASKS;
  }
Alexander Bazo committed
41 42 43 44 45 46 47 48 49 50 51 52
}

schema.defineTypes(Task, {
  imageUrl: "string",
  taskDescription: "string",
  taskSource: "string",
  duration: "number",
  height: "number",
  position: "number",
});

module.exports = Task;