Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. package com.northwind.game.body;
  2.  
  3. import java.awt.Image;
  4. import java.io.File;
  5. import java.io.IOException;
  6. import java.util.ArrayList;
  7.  
  8. import javax.imageio.ImageIO;
  9.  
  10. public final class BodyDefinition {
  11.  
  12.     private int width;
  13.     private int height;
  14.    
  15.     private Image image;
  16.    
  17.     private static ArrayList<BodyDefinition> defs = new ArrayList<>();
  18.    
  19.     public static void loadDefs(String path) {
  20.        
  21.     }
  22.    
  23.     public static BodyDefinition getDef(int id) {
  24.         return defs.get(id);
  25.     }
  26.    
  27.     private BodyDefinition(int width, int height, String path) {
  28.         this.width = width;
  29.         this.height = height;
  30.        
  31.         File file = new File(path);
  32.         try {
  33.             image = ImageIO.read(file);
  34.         } catch (IOException e) {
  35.             e.printStackTrace();
  36.         }
  37.     }
  38.    
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement