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
/
Player.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-27
|
2KB
|
75 lines
// This may look like C code, but it is really -*- C++ -*-
// Module : Player.h Version 1.2
// LastSCCS : 2/26/92 16:38:44
// LastEdit : "Tue Feb 25 10:32:48 1992"
// Description :
// Author :
// Copyright : GMD Schloss Birlinghoven
#ifndef Player_h
#define Player_h
class Player : public GnObject {
protected:
char *name;
int position;
Boolean selected;
Field *fields[3][4][3];
CardList owned_cards;
AxiomList axioms;
protected:
PlayerView *player_view;
GnScrollableMultipleSelectionList *axiom_list;
SleuthDocument *document;
public:
Player(SleuthDocument *doc, int pos);
public:
// Accessors and Modifiers
void SetView(PlayerView *view)
{ player_view = view; }
PlayerView *GetView()
{ return player_view; }
void SetAxiomList(GnScrollableMultipleSelectionList *p_axiom_list)
{ axiom_list = p_axiom_list; }
GnScrollableMultipleSelectionList *GetAxiomList()
{ return axiom_list; }
char *GetName()
{ return document->PlayerName(position); }
int GetPosition()
{ return position; }
SleuthDocument *GetDocument()
{ return document; }
int NumberOfOwnedCards()
{ return owned_cards.Length(); }
Boolean IsSelected()
{ return selected; }
void SetSelected(Boolean state);
public:
Field *GetField(int shape, int color, int value)
{ return fields[shape][color][value]; }
Field *GetField(Field *field)
{ return fields[field->shape][field->color][field->value]; }
FieldStatus GetCard(int shape, int color, int value);
Boolean IsNeutral(int shape, int color, int value)
{ return GetCard(shape, color, value) == eNeutral; }
Boolean IsNeutral(Field *field)
{ return field->GetState() == eNeutral; }
Boolean IsOwned(int shape, int color, int value)
{ return GetCard(shape, color, value) == eOwned; }
Boolean IsNotOwned(int shape, int color, int value)
{ return GetCard(shape, color, value) == eNotOwned; }
void ChangeCard(Field *field, FieldStatus cv);
void Add(Axiom *p_axiom);
void Remove(Axiom *p_axiom);
void PrintAxioms(ostream &p_stream);
public:
Boolean write_to_stream(ostream &stream);
Boolean read_from_stream(istream &stream);
Axiom *FindAxiom(int p_shape, int p_color, int p_value, int p_how_many);
private:
FieldStatus SetCard(int shape, int color, int value, FieldStatus cv);
};
#endif