Package com.sirenian.hellbound.domain.glyph

Examples of com.sirenian.hellbound.domain.glyph.Junk


        glyph.addListeners(glyphListeners);
    return glyph;
    }

  public Junk createJunk(ListenerSet glyphListeners) {
    Junk junk = new Junk(width, this.height);
        junk.addListeners(glyphListeners);
        return junk;
  }
View Full Code Here


        StubHeartbeat heartbeat = new StubHeartbeat();
        Mock glyphFactoryMock = mock(GlyphFactory.class);
       
        LivingGlyph firstGlyph = new LivingGlyph(GlyphType.T, new StubCollisionDetector(13), 3);
        LivingGlyph secondGlyph = new LivingGlyph(GlyphType.S, CollisionDetector.NULL, 3);
        Junk junk = new Junk(7, 13);
       
        glyphFactoryMock.expects("nextGlyph").inOrder()
            .with(new Matcher[] {isA(CollisionDetector.class), isA(ListenerSet.class)})
            .will(returnValue(firstGlyph), returnValue(secondGlyph));
        glyphFactoryMock.expects("createJunk").with(isA(ListenerSet.class)).will(returnValue(junk));

        Segments segmentsForTShapeOnFloor = droppedToFloor(GlyphType.T.getSegments(0).movedRight(3), 13);
       
        Game game = new Game((GlyphFactory) glyphFactoryMock, heartbeat, 7, 13);
        game.requestStartGame();
       
        // When...
        game.requestGlyphMovement(GlyphMovement.DROP);
        heartbeat.beat();
       
        //Then...
        ensureThat(firstGlyph.getSegments(), eq(Segments.EMPTY));
        ensureThat(junk.getSegments(), eq(segmentsForTShapeOnFloor));
        verifyMocks();       
    }
View Full Code Here

        ensureThat(junk.getSegments(), eq(segmentsForTShapeOnFloor));
        verifyMocks();       
    }
   
    public void shouldNotMoveGlyphLeftOrRightIfGlyphIsConstrainedByWalls() {
        Junk junk = new Junk(3, 13);
        class GlyphHolder {
            private LivingGlyph glyph;
        };
        final GlyphHolder holder = new GlyphHolder();
       
View Full Code Here

        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);
       
        listener.expects("reportGlyphMovement").times(2); // once for junk change, once for glyph change
       
        junk.absorb(glyph);
    }
View Full Code Here

TOP

Related Classes of com.sirenian.hellbound.domain.glyph.Junk

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.