2 ////////////////////////////////////////////////////////////////////////////////
3 // This program is free software; you can redistribute it and/or //
4 // modify it under the terms of the GNU General Public License //
5 // version 2 as published by the Free Software Foundation. //
7 // This program is distributed in the hope that it will be useful, but //
8 // WITHOUT ANY WARRANTY; without even the implied warranty of //
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
10 // General Public License for more details. //
12 // Written and (C) by François Fleuret //
13 // Contact <francois.fleuret@epfl.ch> for comments & bug reports //
14 ////////////////////////////////////////////////////////////////////////////////
20 #include "simple_window.h"
28 // A canonical name for the task, upper caps, digits and "_"
29 virtual char *name() = 0;
30 // A task can be started with several degrees of difficulty
31 virtual int nb_degrees() = 0;
32 // Returns the size of the area
33 virtual int width() = 0;
34 virtual int height() = 0;
35 // Initializes the world (put polygons with Universe::add_polygon)
36 virtual void init(Universe *universe, int degree) = 0;
38 virtual void update(scalar_t dt, Universe *universe, Manipulator *manipulator) = 0;
39 // Computes and returns the reward (can be positive or negative)
40 virtual scalar_t reward(Universe *universe, Manipulator *manipulator) = 0;
41 // If we need to draw something
42 virtual void draw(SimpleWindow *window) = 0;
45 // Loads a shared object file
47 Task *load_task(char *filename);