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
/
Field.C
< prev
next >
Wrap
Text File
|
1992-02-27
|
973b
|
37 lines
// This may look like C code, but it is really -*- C++ -*-
// Module : Field.C Version 1.2
// LastSCCS : 2/26/92 16:37:54
// LastEdit : "Fri Nov 8 13:40:45 1991"
// Description :
// Author :
// Copyright : GMD Schloss Birlinghoven
Field::
Field(Player *p_player, Card *p_card, int p_shape, int p_color, int p_value)
: PlayerLocation(p_player, p_shape, p_color, p_value)
{
REQUIRE(p_shape >= 0 && p_shape <= 2, "Shape is 0, 1, or 2");
REQUIRE(p_color >= 0 && p_color <= 3, "Color is 0, 1, 2, or 3");
REQUIRE(p_value >= 0 && p_value <= 2, "Value is 0, 1, or 2");
card = p_card;
field_status = eNeutral;
}
FieldStatus Field::
SetState(FieldStatus p_field_status)
{
FieldStatus old_state = field_status;
field_status = p_field_status;
return old_state;
}
void Field::
Change(FieldStatus status)
{
player->ChangeCard(this, status);
}
ImplGenericListWithIterator(FieldList,FieldListIterator);