Package com.sirenian.hellbound.util

Examples of com.sirenian.hellbound.util.ListenerSet


  private long timeBetweenBeats;
  private boolean beating;
    private String state;

  public AcceleratingHeartbeat() {
    listenerSet = new ListenerSet();
    pulse = new ListenerNotifier(){
      public void notify(Listener listener) {
        ((HeartbeatListener)listener).beat();
      }};
  }
View Full Code Here


  public Game(GlyphFactory factory, Heartbeat heartbeat, int width, int height) {
    this.factory = factory;
    this.heartbeat = heartbeat;
        this.width = width;
    this.height = height;
    gameListeners = new ListenerSet();
    glyphListeners = new ListenerSet();
    state = GameState.READY;
   
    stateNotifier = new ListenerNotifier() {
      public void notify(Listener listener) {
        ((GameListener)listener).reportGameStateChanged(state);
View Full Code Here

            Ensure.that(nextGlyphType(factory) == expected[i]);
        }
    }
   
    public void shouldAddListenersToTheGlyphsThatItCreates() {
        ListenerSet listenerSet = new ListenerSet();
        Mock listener = mock(GlyphListener.class);
        listenerSet.addListener((Listener) listener);
       
        PseudoRandomGlyphFactory factory = new PseudoRandomGlyphFactory(42, 7, 13);
        LivingGlyph glyph = factory.nextGlyph(CollisionDetector.NULL, listenerSet);
        Junk junk = factory.createJunk(listenerSet);
       
View Full Code Here

       
        junk.absorb(glyph);
    }

    private GlyphType nextGlyphType(PseudoRandomGlyphFactory factory) {
        return factory.nextGlyph(CollisionDetector.NULL, new ListenerSet()).type();
    }
View Full Code Here

    Mock listener2 = mock(GlyphListener.class);

    expectGlyphMovement(listener1, GlyphType.O.getSegments(0), GlyphType.O.getSegments(0));
    expectGlyphMovement(listener2, GlyphType.O.getSegments(0), GlyphType.O.getSegments(0));
   
    ListenerSet listenerSet = new ListenerSet();
    listenerSet.addListener((GlyphListener) listener1);
    listenerSet.addListener((GlyphListener) listener2);
   
    glyph.addListeners(listenerSet);
   
    verifyMocks();
 
View Full Code Here

 
  private ListenerSet listeners;
  private ListenerNotifier glyphMovementNotifier;

  public Glyph(GlyphType type, Segments firstPosition) {
    this.listeners = new ListenerSet();
    this.type = type;
   
    previousSegments = firstPosition;
    segments = firstPosition;
   
View Full Code Here

  private ListenerNotifier pulse;
    private boolean beating;
    private boolean skipped;
 
  public ForcedHeartbeat() {
    listeners = new ListenerSet();
    pulse = new ListenerNotifier() {
      public void notify(Listener listener) {
        ((HeartbeatListener)listener).beat();
      }     
    };
View Full Code Here

TOP

Related Classes of com.sirenian.hellbound.util.ListenerSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.