/ *   
 
   *   P R O J E C T :   N y A R T o o l k i t ( E x t e n s i o n ) 
 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
   *   T h e   N y A R T o o l k i t   i s   J a v a   e d i t i o n   A R T o o l K i t   c l a s s   l i b r a r y . 
 
   *   C o p y r i g h t   ( C ) 2 0 0 8 - 2 0 0 9   R y o   I i z u k a 
 
   * 
 
   *   T h i s   p r o g r a m   i s   f r e e   s o f t w a r e :   y o u   c a n   r e d i s t r i b u t e   i t   a n d / o r   m o d i f y 
 
   *   i t   u n d e r   t h e   t e r m s   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e   a s   p u b l i s h e d   b y 
 
   *   t h e   F r e e   S o f t w a r e   F o u n d a t i o n ,   e i t h e r   v e r s i o n   3   o f   t h e   L i c e n s e ,   o r 
 
   *   ( a t   y o u r   o p t i o n )   a n y   l a t e r   v e r s i o n . 
 
   *   
 
   *   T h i s   p r o g r a m   i s   d i s t r i b u t e d   i n   t h e   h o p e   t h a t   i t   w i l l   b e   u s e f u l , 
 
   *   b u t   W I T H O U T   A N Y   W A R R A N T Y ;   w i t h o u t   e v e n   t h e   i m p l i e d   w a r r a n t y   o f 
 
   *   M E R C H A N T A B I L I T Y   o r   F I T N E S S   F O R   A   P A R T I C U L A R   P U R P O S E .     S e e   t h e 
 
   *   G N U   G e n e r a l   P u b l i c   L i c e n s e   f o r   m o r e   d e t a i l s . 
 
   * 
 
   *   Y o u   s h o u l d   h a v e   r e c e i v e d   a   c o p y   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e 
 
   *   a l o n g   w i t h   t h i s   p r o g r a m .     I f   n o t ,   s e e   < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > . 
 
   *   
 
   *   F o r   f u r t h e r   i n f o r m a t i o n   p l e a s e   c o n t a c t . 
 
   * 	 h t t p : / / n y a t l a . j p / n y a t o o l k i t / 
 
   * 	 < a i r m a i l ( a t ) e b o n y . p l a l a . o r . j p >   o r   < n y a t l a ( a t ) n y a t l a . j p > 
 
   *   
 
   * / 
 
 u s i n g   S y s t e m . C o l l e c t i o n s . G e n e r i c ; 
 
 u s i n g   j p . n y a t l a . n y a r t o o l k i t . c s . c o r e ; 
 
 u s i n g   j p . n y a t l a . n y a r t o o l k i t . c s . p s a r p l a y c a r d ; 
 
 u s i n g   S y s t e m . C o l l e c t i o n s ; 
 
 n a m e s p a c e   j p . n y a t l a . n y a r t o o l k i t . c s . m a r k e r s y s t e m . u t i l s 
 
 { 
 
         / * * 
 
           *   S0n0000o00A R 000000n0iQP}g000000W0~0Y00
 
           * / 
 
         p u b l i c   c l a s s   A R P l a y C a r d L i s t   :   L i s t < A R P l a y C a r d L i s t . I t e m > 
 
         { 
 
 	         p u b l i c   c l a s s   I t e m   :   T M a r k e r D a t a 
 
 	         { 
 
 	 	         / * *   I d n0`1X0  S_Y00i d n0Y000* / 
 
 	 	         p u b l i c   i n t   n y i d _ r a n g e _ s ; 
 
 	 	         / * *   I d n0`1X0  S_Y00i d n0B}N000* / 
 
 	 	         p u b l i c   i n t   n y i d _ r a n g e _ e ; 
 
 	 	         / * *   I d n0`1X0  [n0i d $P* / 
 
 	 	         p u b l i c   l o n g   i d ; 
 
 	 	         p u b l i c   i n t   d i r ; 
 
 	 	         / * * 
 
 	 	           *   0000000g0Y00Rg$PK000I d 000n00000000ubW0~0Y00
 
 	 	           *   @ p a r a m   i _ r a n g e _ s 
 
 	 	           *   @ p a r a m   i _ r a n g e _ e 
 
 	 	           *   @ p a r a m   i _ p a t t _ s i z e 
 
 	 	           *   @ t h r o w s   N y A R E x c e p t i o n 
 
 	 	           * / 
 
 	 	         p u b l i c   I t e m ( i n t   i _ i d _ r a n g e _ s , i n t   i _ i d _ r a n g e _ e , d o u b l e   i _ p a t t _ s i z e ) : b a s e ( ) 
 
 	 	         { 
 
 	 	 	         t h i s . m a r k e r _ o f f s e t . s e t S q u a r e ( i _ p a t t _ s i z e ) ; 
 
 	 	 	         t h i s . n y i d _ r a n g e _ s = i _ i d _ r a n g e _ s ; 
 
 	 	 	         t h i s . n y i d _ r a n g e _ e = i _ i d _ r a n g e _ e ; 
 
 	 	 	         r e t u r n ; 
 
 	 	         } 	 	 
 
 	         } 	 
 
 	         / * * *퐨c[hV* / 
 
 	         p r i v a t e   P s A R P l a y C a r d P i c k u p   _ p i c k u p ; 
 
 	         p r i v a t e   P s A R P l a y C a r d P i c k u p . P s A r I d P a r a m   _ i d _ p a r a m = n e w   P s A R P l a y C a r d P i c k u p . P s A r I d P a r a m ( ) ; 
 
 	         p u b l i c   A R P l a y C a r d L i s t ( ) 
 
 	         { 
 
 	 	         t h i s . _ p i c k u p   =   n e w   P s A R P l a y C a r d P i c k u p ( ) ; 
 
 	         } 
 
 	         p u b l i c   v o i d   p r e p a r e ( ) 
 
 	         { 
 
                         / / n o t h i n g   t o   d o 
 
                         / / s q o0t r a c k i n g g0n u l l RgSn0
 
 	 	 
 
 	         } 
 
 	         p u b l i c   b o o l   u p d a t e ( I N y A R G r a y s c a l e R a s t e r   i _ r a s t e r , S q u a r e S t a c k . I t e m   i _ s q ) 
 
 	         { 
 
 	 	         i f ( ! t h i s . _ p i c k u p . g e t A R P l a y C a r d I d ( i _ r a s t e r . g e t G s P i x e l D r i v e r ( ) , i _ s q . o b _ v e r t e x , t h i s . _ i d _ p a r a m ) ) 
 
 	 	         { 
 
 	 	 	         r e t u r n   f a l s e ; 
 
 	 	         } 
 
 	 	         / / I D 0iQ
 
 	 	         i n t   s = t h i s . _ i d _ p a r a m . i d ; 
 
 	 	         f o r ( i n t   i = t h i s . C o u n t - 1 ; i > = 0 ; i - - ) { 
 
 	 	 	         I t e m   t a r g e t = t h i s [ i ] ; 
 
 	 	 	         i f ( t a r g e t . n y i d _ r a n g e _ s > s   | |   s > t a r g e t . n y i d _ r a n g e _ e ) 
 
 	 	 	         { 
 
 	 	 	 	         c o n t i n u e ; 
 
 	 	 	         } 
 
 	 	 	         / / ek0Xnj00!q
 
 	 	 	         i f ( t a r g e t . l o s t _ c o u n t = = 0 ) { 
 
 	 	 	 	         c o n t i n u e ; 
 
 	 	 	         } 
 
 	 	 	         / /  NW0_0000
 
 	 	 	         t a r g e t . i d = s ; 
 
 	 	 	         t a r g e t . d i r = t h i s . _ i d _ p a r a m . d i r e c t i o n ; 
 
 	 	 	         t a r g e t . s q = i _ s q ; 
 
 	 	 	         r e t u r n   t r u e ; 
 
 	 	         } 
 
 	 	         r e t u r n   f a l s e ; 
 
 	         } 
 
 	         p u b l i c   v o i d   f i n i s h ( ) 
 
 	         { 
 
                         f o r   ( i n t   i   =   t h i s . C o u n t   -   1 ;   i   > =   0 ;   i - - ) 
 
 	 	         { 
 
 	 	 	         I t e m   t a r g e t = t h i s [ i ] ; 
 
 	 	 	         i f ( t a r g e t . s q = = n u l l ) { 
 
 	 	 	 	         c o n t i n u e ; 
 
 	 	 	         } 
 
 	 	 	         i f ( t a r g e t . l o s t _ c o u n t > 0 ) { 
 
 	 	 	 	         / / Sgqo0]0n0~0~0g00d i r `0Q0teY000
 
 	 	 	 	         t a r g e t . l o s t _ c o u n t = 0 ; 
 
 	 	 	 	         t a r g e t . l i f e + + ; 
 
 	 	 	 	         t a r g e t . s q . r o t a t e V e r t e x L ( 4 - t a r g e t . d i r ) ; 
 
 	 	 	 	         N y A R I n t P o i n t 2 d . s h i f t C o p y ( t a r g e t . s q . o b _ v e r t e x , t a r g e t . t l _ v e r t e x , 4 - t a r g e t . d i r ) ; 
 
 	 	 	 	         t a r g e t . t l _ c e n t e r . s e t V a l u e ( t a r g e t . s q . c e n t e r 2 d ) ; 
 
 	 	 	 	         t a r g e t . t l _ r e c t _ a r e a = t a r g e t . s q . r e c t _ a r e a ; 
 
 	 	 	         } 
 
 	 	         } 
 
 	         } 	 
 
         } 
 
 } 