Пример #1
0
    return ($bit & $adv->aflags) !== 0;
}
function atrz(Adv $adv, $bit)
{
    $adv->aflags &= $bit ^ -1;
    return $adv->aflags;
}
function atro(Adv $adv, $bit)
{
    $adv->aflags |= $bit;
    return $adv->aflags;
}
// Slots for room
make_slot('RVAL', 0);
// Value for entering
make_slot('RGLOBAL', gval('STAR_BITS'));
// Globals for room
flagword(...['RSEENBIT', 'RLIGHTBIT', 'RLANDBIT', 'RWATERBIT', 'RAIRBIT', 'RSACREDBIT', 'RFILLBIT', 'RMUNGBIT', 'RBUCKBIT', 'RHOUSEBIT', 'RENDGAME', 'RNWALLBIT']);
// SFLAGs of a SYNTAX
flagword(...['SFLIP', 'SDRIVER']);
/**
 * Test a bit in the SFLAGs slot of a SYNTAX
 *
 * @param Itafroma\Zork\Struc\Syntax $s   The syntax to test
 * @param int                       $bit The bit to test
 * @return boolean FALSE if bit is set, TRUE otherwise
 */
function strnn(Syntax $s, $bit)
{
    return ($bit & $s->sflags) !== 0;
}
Пример #2
0
 /**
  * Test Itafroma\Zork\make_slot() slot read.
  *
  * @covers ::Itafroma\Zork\make_slot
  * @dataProvider objectPropertyProvider
  */
 public function testMakeSlotRead($struc, $property_key, $property_value)
 {
     $slots = make_slot($property_key, $property_value);
     $slots[$property_key]($struc, $property_value);
     $this->assertEquals($property_value, $slots[$property_key]($struc));
 }