
    Xic                       % S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  SSK
Jr  SS	KJrJrJrJrJr  S
rSrSrSrSrSr\S\S\S\S0rSrSrSr\ " S S\5      5       r\" \S5      \" \S5      /\" \S5      \" \S5      /\" \S5      \" \S5      /\" \S5      /\" \S5      /\" \S5      /\" \S5      \" \S5      /\" \S5      /\" \S5      \" \S5      /\" \S5      \" \S5      //
rS\S'   \" SS5       V s0 s H  o SU  3_M
     sn r S\S '   / S!Qr!\ " S" S#\5      5       r"\ " S$ S%\	5      5       r#/ S&Qr$S'S(S)S*S+S,S-S.S/S&.	r%\ " S0 S1\5      5       r&g2s  sn f )3z=Phase 10 state dataclasses, phase definitions, and constants.    )annotations)	dataclassfield)DataClassJSONMixin   )Player   )Card)GameOptions	IntOption
BoolOption
MenuOptionoption_field            zphase10-color-redzphase10-color-bluezphase10-color-greenzphase10-color-yellowsetruncolorc                  .    \ rS rSr% SrS\S'   S\S'   Srg)	PhaseRequirement3   zEOne group requirement within a phase (e.g. 'set of 3' or 'run of 4').strkindintcount N)__name__
__module____qualname____firstlineno____doc____annotations____static_attributes__r       games/phase10/state.pyr   r   3   s    O
IJr&   r         	      zlist[list[PhaseRequirement]]PHASES   zphase10-phase-desc-zdict[int, str]PHASE_DESC_KEYS)r   r      r)   
   c                  N    \ rS rSr% SrS\S'   S\S'   S\S'   \" \S	9rS
\S'   Sr	g)
TableGroupT   a0  A single group laid down on the table by a player.

Attributes:
    owner_id: Player ID of the owner.
    group_index: 0-based index of this group among the owner's groups.
    requirement: The phase requirement this group satisfies.
    cards: Cards currently in this group (grows as hits are applied).
r   owner_idr   group_indexr   requirementdefault_factory
list[Card]cardsr   N)
r   r    r!   r"   r#   r$   r   listr:   r%   r   r&   r'   r2   r2   T   s)     M!!d3E:3r&   r2   c                  h    \ rS rSr% Sr\" \S9rS\S'   Sr	S\S'   S	r
S
\S'   SrS\S'   S	rS
\S'   Srg)Phase10Playerj   a  Per-player state for Phase 10.

Attributes:
    hand: Cards currently in hand.
    current_phase: The phase number this player is working on (1-10).
    phase_laid_down: True once the player has laid their phase down this hand.
    score: Accumulated penalty points across all hands.
    skipped: True if a Skip card has been played against this player and
             their next turn should be forfeited.
r7   r9   handr   r   current_phaseFboolphase_laid_downr   scoreskippedr   N)r   r    r!   r"   r#   r   r;   r?   r$   r@   rB   rC   rD   r%   r   r&   r'   r=   r=   j   s?    	 T2D*2M3!OT!E3NGTr&   r=   )	5101520304560900zphase10-timer-5zphase10-timer-10zphase10-timer-15zphase10-timer-20zphase10-timer-30zphase10-timer-45zphase10-timer-60zphase10-timer-90zphase10-timer-unlimitedc                      \ rS rSr% Sr\" \" SSSSSSSS	95      rS
\S'   \" \	" \
SSSS\S95      rS\S'   \" \" SSSSS95      rS\S'   \" \" SSSSS95      rS\S'   Srg)Phase10Options   z"Configurable options for Phase 10.r0   r   phasezphase10-set-winning-phasezphase10-enter-winning-phasez$phase10-option-changed-winning-phase)defaultmin_valmax_val	value_keylabelprompt
change_msgr   winning_phaserM   zphase10-set-turn-timerzphase10-select-turn-timerz!phase10-option-changed-turn-timer)choicesrR   rV   rW   rX   choice_labelsr   
turn_timerFenabledzphase10-toggle-even-phasesz"phase10-option-changed-even-phases)rR   rU   rV   rX   rA   even_phases_onlyzphase10-toggle-fixed-handsz"phase10-option-changed-fixed-handsfixed_handsr   N)r   r    r!   r"   r#   r   r   rY   r$   r   TURN_TIMER_CHOICESTURN_TIMER_LABELSr\   r   r^   r_   r%   r   r&   r'   rO   rO      s    ,%-0=	

M3 
 #&*.:+	
	J 	 *.;		
d  %.;		
K r&   rO   N)'r#   
__future__r   dataclassesr   r   mashumaro.mixins.jsonr   baser   game_utils.cardsr
   game_utils.optionsr   r   r   r   r   P10_RANK_WILDP10_RANK_SKIPP10_COLOR_REDP10_COLOR_BLUEP10_COLOR_GREENP10_COLOR_YELLOWP10_COLOR_NAMES	GROUP_SET	GROUP_RUNGROUP_COLORr   r,   r$   ranger.   EVEN_PHASESr2   r=   r`   ra   rO   )is   0r'   <module>ru      s   C " ( 4  $    &(*,	 		 )   i#%5i%CDi#%5i%CDi#%5i%CDi#$i#$i#$i#%5i%CDk1%&i#%5i%CDi#%5i%CD($  JOqRT"VA(;A3&?#?"V V  4# 4 4* F  . J 	






	"
  '[ ' 'O #Ws   :E