44
55import com .google .inject .Inject ;
66
7- public class SpriteSheetLoader {
7+ public class SpriteSheetSplitter {
88 private String name ;
99 private String sourceImage ;
1010 private Integer width ;
@@ -17,7 +17,7 @@ public class SpriteSheetLoader {
1717 private final GraphicEntityModule graphicEntityModule ;
1818
1919 @ Inject
20- public SpriteSheetLoader (GraphicEntityModule graphicEntityModule ) {
20+ public SpriteSheetSplitter (GraphicEntityModule graphicEntityModule ) {
2121 this .graphicEntityModule = graphicEntityModule ;
2222 }
2323
@@ -53,51 +53,51 @@ public int getImagesPerRow() {
5353 return imagesPerRow ;
5454 }
5555
56- public SpriteSheetLoader setName (String name ) {
56+ public SpriteSheetSplitter setName (String name ) {
5757 this .name = name ;
5858 return this ;
5959 }
6060
61- public SpriteSheetLoader setSourceImage (String sourceImage ) {
61+ public SpriteSheetSplitter setSourceImage (String sourceImage ) {
6262 this .sourceImage = sourceImage ;
6363 return this ;
6464 }
6565
66- public SpriteSheetLoader setWidth (int width ) {
66+ public SpriteSheetSplitter setWidth (int width ) {
6767 this .width = width ;
6868 return this ;
6969 }
7070
71- public SpriteSheetLoader setHeight (int height ) {
71+ public SpriteSheetSplitter setHeight (int height ) {
7272 this .height = height ;
7373 return this ;
7474 }
7575
76- public SpriteSheetLoader setOrigRow (int origRow ) {
76+ public SpriteSheetSplitter setOrigRow (int origRow ) {
7777 this .origRow = origRow ;
7878 return this ;
7979 }
8080
81- public SpriteSheetLoader setOrigCol (int origCol ) {
81+ public SpriteSheetSplitter setOrigCol (int origCol ) {
8282 this .origCol = origCol ;
8383 return this ;
8484 }
8585
86- public SpriteSheetLoader setImageCount (int imageCount ) {
86+ public SpriteSheetSplitter setImageCount (int imageCount ) {
8787 this .imageCount = imageCount ;
8888 return this ;
8989 }
9090
91- public SpriteSheetLoader setImagesPerRow (int imagesPerRow ) {
91+ public SpriteSheetSplitter setImagesPerRow (int imagesPerRow ) {
9292 this .imagesPerRow = imagesPerRow ;
9393 return this ;
9494 }
9595
9696 /**
97- * Load a spritesheet (all fields are required except imagesPerRow). Returns an array of image names that can be used in Sprite or SpriteAnimation.
97+ * Splits up a spritesheet (all fields are required except imagesPerRow). Returns an array of image names that can be used in Sprite or SpriteAnimation.
9898 * @return an array of image names.
9999 */
100- public String [] load () {
100+ public String [] split () {
101101 if (name == null ) {
102102 throw new IllegalStateException ("invalid name" );
103103 }
@@ -120,7 +120,7 @@ public String[] load() {
120120 throw new IllegalStateException ("invalid origCol" );
121121 }
122122
123- graphicEntityModule .loadSpriteSheet (this );
123+ graphicEntityModule .loadSpriteSheetSplitter (this );
124124 if (imageCount > 1 ) {
125125 return IntStream .range (0 , imageCount ).mapToObj (i -> name + i ).toArray (String []::new );
126126 } else {
0 commit comments