org.eviline.randomizer
Class ConcurrentRandomizer

java.lang.Object
  extended by org.eviline.randomizer.AbstractRandomizer
      extended by org.eviline.randomizer.ConcurrentRandomizer
All Implemented Interfaces:
Serializable, Randomizer

public class ConcurrentRandomizer
extends AbstractRandomizer
implements Randomizer, Serializable

Randomizer which runs concurrently with game play. This Randomizer doesn't use the state of the board after a piece is locked, but rather the state of the board while the piece is falling, to determine what it will return. Really it just delegates this question to its argument, which is presumed to be a slow implementation.

Author:
robin
See Also:
Serialized Form

Field Summary
protected  Exchanger<Object> exchanger
           
protected  RunnableFuture<?> future
           
protected  Randomizer provider
           
protected  String taunt
           
 
Constructor Summary
ConcurrentRandomizer(Randomizer p)
           
 
Method Summary
 PropertySource config()
           
 String getTaunt()
           
 String name()
           
 Shape provideShape(Field f)
          Return the Shape to be next played on the argument Field
 Object writeReplace()
           
 
Methods inherited from class org.eviline.randomizer.AbstractRandomizer
getNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eviline.randomizer.Randomizer
getNext
 

Field Detail

provider

protected Randomizer provider

exchanger

protected transient Exchanger<Object> exchanger

future

protected transient RunnableFuture<?> future

taunt

protected transient String taunt
Constructor Detail

ConcurrentRandomizer

public ConcurrentRandomizer(Randomizer p)
Method Detail

provideShape

public Shape provideShape(Field f)
Description copied from interface: Randomizer
Return the Shape to be next played on the argument Field

Specified by:
provideShape in interface Randomizer
Returns:

getTaunt

public String getTaunt()
Specified by:
getTaunt in interface Randomizer

writeReplace

public Object writeReplace()
                    throws ObjectStreamException
Throws:
ObjectStreamException

config

public PropertySource config()
Specified by:
config in interface Randomizer

name

public String name()
Specified by:
name in interface Randomizer


Copyright © 2013. All Rights Reserved.