@Test public void spawnYellow() { when(random.nextDouble()).thenReturn(0.6); when(random.nextInt(anyInt())).thenReturn(3); context.poll(); assertThat(nexus.spawn().getType()).isEqualTo(MarbleType.YELLOW); }
public Marble spawn() { if (getContext().isOccupied()) { throw new IllegalStateException("The nexus is already occupied by a marble"); } Marble marble = new Marble(getContext().poll()); accept(direction, marble); getContext().setOccupied(true); return marble; }
SpawningNexus extends Nexus { public Marble spawn() { if (getContext().isOccupied()) { throw new IllegalStateException("The nexus is already occupied by a marble"); } Marble marble = new Marble(getContext().poll()); accept(direction, marble); getContext().setOccupied(true); return marble; } }
SpawningNexus extends Nexus { public Marble spawn() { if (getContext().isOccupied()) { throw new IllegalStateException("The nexus is already occupied by a marble"); } Marble marble = new Marble(getContext().poll()); accept(direction, marble); getContext().setOccupied(true); return marble; } SpawningNexus(NexusContext context, Direction direction); }
SpawningNexus extends Nexus { public Marble spawn() { if (getContext().isOccupied()) { throw new IllegalStateException("The nexus is already occupied by a marble"); } Marble marble = new Marble(getContext().poll()); accept(direction, marble); getContext().setOccupied(true); return marble; } SpawningNexus(NexusContext context, Direction direction); Marble spawn(); Direction getDirection(); }
SpawningNexus extends Nexus { public Marble spawn() { if (getContext().isOccupied()) { throw new IllegalStateException("The nexus is already occupied by a marble"); } Marble marble = new Marble(getContext().poll()); accept(direction, marble); getContext().setOccupied(true); return marble; } SpawningNexus(NexusContext context, Direction direction); Marble spawn(); Direction getDirection(); static final Property<Double> JOKER_PROBABILITY; static final Property<List<String>> INITIAL_SEQUENCE; }