\ VP-scoringcards
\ Tracks which cards are
\ involved in score
\
\ $Id: VP-scoringcards.txt,v 1.1 2000/10/25 01:02:57 kris_johnson Exp $

\ Copyright 2000
\ Kristopher D. Johnson
\ 
\ See LICENSE-JacksOrBetter for the
\ conditions under which you may
\ use, redistribute, or modify this 
\ code, or create derived works.

docneeds VP-globals

.( VP-scoringcards... )

\ Array of flags indicating which cards
\ in hand were involved in score
#Hand array ScoringCard

0 ScoringCard
constant 0ScoringCard

#Hand ScoringCard
constant LimScoringCard

LimScoringCard 0ScoringCard -
constant /ScoringCard

\ Return flag indicating whether
\ given card in hand was involved
\ in score. The results of this are
\ only valid after calling score-hand.
: scoring-card? ( n -- f )
  ScoringCard @ ;

\ Mark all cards in hand as scoring
: all-scoring ( -- )
  LimScoringCard 0ScoringCard do
    true i !
  cell +loop
;

\ Mark as scoring all cards of
\ given rank in hand
: scoring-rank ( rank -- )
  #Hand 0 do
    dup i Hand card>rank = if
      true i ScoringCard !
    then
  loop
  drop
;

