home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
g
/
gina15.zip
/
demos
/
sleuth
/
PlayerLocation
< prev
next >
Wrap
Text File
|
1992-02-27
|
2KB
|
59 lines
// This may look like C code, but it is really -*- C++ -*-
// Module : PlayerLocation.h Version 1.2
// LastSCCS : 2/26/92 16:38:56
// LastEdit : "Mon Jan 27 13:17:57 1992"
// Description :
// Author :
// Copyright : GMD Schloss Birlinghoven
#ifndef Playerlocation_h
#define Playerlocation_h
const int UndefShape = 3;
const int UndefColor = 4;
const int UndefValue = 3;
inline int IsUndefShape(int shape) { return shape == UndefShape; }
inline int IsUndefColor(int color) { return color == UndefColor; }
inline int IsUndefValue(int value) { return value == UndefValue; }
inline int IsShape(int shape) { return shape >= 0 && shape <= UndefShape; }
inline int IsColor(int color) { return color >= 0 && color <= UndefColor; }
inline int IsValue(int value) { return value >= 0 && value <= UndefValue; }
inline int IsTrueShape(int shape) { return shape >= 0 && shape < UndefShape; }
inline int IsTrueColor(int color) { return color >= 0 && color < UndefColor; }
inline int IsTrueValue(int value) { return value >= 0 && value < UndefValue; }
inline int AllUndef(int shape, int color, int value)
{ return IsUndefShape(shape) && IsUndefColor(color) && IsUndefValue(value); }
inline int AllDef(int shape, int color, int value)
{ return IsTrueShape(shape) && IsTrueColor(color) && IsTrueValue(value); }
class Player;
class PlayerLocation : public GnPresentable {
protected:
PlayerLocation(Player *p_player, int p_shape, int p_color, int p_value);
public:
int GetColor()
{ return color; }
int GetShape()
{ return shape; }
int GetValue()
{ return value; }
Player *GetPlayer()
{ return player; }
public:
virtual char *PrintOn(char *buffer, unsigned int length);
protected:
int color;
int shape;
int value;
Player *player;
};
#endif