File: speed.h

package info (click to toggle)
powder 117-2
  • links: PTS
  • area: non-free
  • in suites: stretch
  • size: 10,576 kB
  • ctags: 3,545
  • sloc: cpp: 55,002; makefile: 541; sh: 258; objc: 245; ansic: 107; csh: 54
file content (65 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download | duplicates (7)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * PROPRIETARY INFORMATION.  This software is proprietary to POWDER
 * Development, and is not to be reproduced, transmitted, or disclosed
 * in any way without written permission.
 *
 * Produced by:	Jeff Lait
 *
 *      	POWDER Development
 *
 * NAME:        speed.h ( POWDER Library, C++ )
 *
 * COMMENTS:
 * 	This controls the speed system of POWDER.
 * 	The speed system is intentionaly simplistic.  More complicated
 * 	systems are attempts to kludge a continuous process on an essentially
 * 	turn oriented game.
 * 	Hopefully this decision does not become too regretable.
 */

#ifndef __speed_h__
#define __speed_h__

class SRAMSTREAM;

//
// These are the possible phases we can be in each turn.
// MOBs get actions every phase, but may want to skip their move
// or their heartbeat depending on the phase.
enum PHASE_NAMES
{
    PHASE_NORMAL,		// heartbeats, everyone gets action.
    PHASE_SLOW,			// heartbeats.  Slowed people get no action.
    PHASE_FAST,			// no heart, fast get action
    PHASE_QUICK,		// no heart, quick get action.
    NUM_PHASES
};

// One time speed initialization.
void speed_init();

// Returns the current phase.
PHASE_NAMES speed_getphase();

// Returns true if we are in a heartbeat phase.
bool	    speed_isheartbeatphase();

// Returns true if we are on this modulus of the heartbeat
bool	    speed_matchheartbeat(int modulus);

// Increments the global time
void speed_ticktime();

// Resets the time to 0 for a new game.
void speed_reset();

// Get the current time value.
int speed_gettime();

// Save the speed related information.
void speed_save(SRAMSTREAM &os);

// And load
void speed_load(SRAMSTREAM &is);

#endif