Pull requests

#15 Merged
Repository
lucas_cimon
Branch
default
Repository
kevglass
Branch
default

Making Renderable class more polymorphic

Author
  1. lucas_cimon
Reviewers
Description

The interface Renderable provides only a "draw(x,y)" method.

However the classes Image & Animation that implement this interface share "draw" functions where you can specify the width/height or a color filter.

It would be nice to add those methods to Renderable in order to make it possible to, e.g., call "draw(x,y,width,height)" on any Renderable object.

With the current code, no such polymorphism is possible.

Here is the extensive list of classes implementing Renderable : http://slick.ninjacave.com/javadoc/org/newdawn/slick/Renderable.html

All those classes implement the 4 new Renderable methods, hence this change should be fully transparent and have zero negative impact.

PS: This is my 1st pull request here / on bitbucket / ever. Feel free to tell me if I shouldn't submit this 'ad-hoc' (missing tests, unclear rationale...), or if I missed some steps in the 'submitting changes in slick protocol' (introduce myself, describe the change on a forum...)

  • Learn about pull requests

Comments (2)