@Test public void testDefaultPipeline() { final Sequence invokeSequence = mockery.sequence("sequence-name"); mockery.checking(new Expectations() { { oneOf(operation1).apply(gc, g); inSequence(invokeSequence); oneOf(operation2).apply(gc, g); inSequence(invokeSequence); oneOf(operation2).unapply(gc, g); inSequence(invokeSequence); oneOf(operation1).unapply(gc, g); inSequence(invokeSequence); } }); pipeline.render(gc, g); }
public void render(GameContainer gc, Graphics g) { for(RenderOperation stage : operations) { stage.apply(gc, g); } if(oneWay) { return; } for(int i = operations.size - 1; i >= 0; i--) { operations.get(i).unapply(gc, g); } }
RenderPipeline { public void render(GameContainer gc, Graphics g) { for(RenderOperation stage : operations) { stage.apply(gc, g); } if(oneWay) { return; } for(int i = operations.size - 1; i >= 0; i--) { operations.get(i).unapply(gc, g); } } }
RenderPipeline { public void render(GameContainer gc, Graphics g) { for(RenderOperation stage : operations) { stage.apply(gc, g); } if(oneWay) { return; } for(int i = operations.size - 1; i >= 0; i--) { operations.get(i).unapply(gc, g); } } RenderPipeline(); }
RenderPipeline { public void render(GameContainer gc, Graphics g) { for(RenderOperation stage : operations) { stage.apply(gc, g); } if(oneWay) { return; } for(int i = operations.size - 1; i >= 0; i--) { operations.get(i).unapply(gc, g); } } RenderPipeline(); void update(GameContainer gc, float delta); void interpolate(GameContainer gc, float alpha); void render(GameContainer gc, Graphics g); void add(RenderOperation operation); void remove(RenderOperation operation); boolean isOneWay(); void setOneWay(boolean oneWay); }
RenderPipeline { public void render(GameContainer gc, Graphics g) { for(RenderOperation stage : operations) { stage.apply(gc, g); } if(oneWay) { return; } for(int i = operations.size - 1; i >= 0; i--) { operations.get(i).unapply(gc, g); } } RenderPipeline(); void update(GameContainer gc, float delta); void interpolate(GameContainer gc, float alpha); void render(GameContainer gc, Graphics g); void add(RenderOperation operation); void remove(RenderOperation operation); boolean isOneWay(); void setOneWay(boolean oneWay);  }