File: timeleft.h

package info (click to toggle)
enemylines3 1.2-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,380 kB
  • ctags: 1,444
  • sloc: cpp: 16,323; makefile: 74; sh: 52
file content (44 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __el_timeleft_h
#define __el_timeleft_h

#include "../release.h"
#include "../coordinate.h"

#include <iostream>


namespace PRJID {


// a countdown
class Timeleft {
	C3f scale;
	C3f trans;
	C3 color;

	unsigned int max;
	unsigned int current;
public:
	Timeleft(unsigned int m=1000);
	~Timeleft();
	

	unsigned int get_current() { return current; }
	unsigned int get_max() { return max; }
	unsigned int get_left() { if (current>=max) return 0; return max-current; }
	bool over();

	void reset();

	bool tick(unsigned int ticks);

	int percent();

	void dim(C3 c,C3f s,C3f t);
	void draw();
};


} //namespace

#endif