Advertisement
Guest User

Untitled

a guest
Jan 26th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. package map;
  2.  
  3. import java.awt.Color;
  4.  
  5. import graphics.Cube;
  6.  
  7. public class MapReader {
  8.     int [][] mapi;
  9.     public Cube [] [] c;
  10.  
  11.     public MapReader(int [][] mapi){
  12.         mapi = new int [24] [32];
  13.         this.mapi = mapi;
  14.         c = new Cube[24] [32];
  15.         Converter();
  16.     }
  17.    
  18.     public void Converter(){
  19.         int x = 0;
  20.         int y = 0;
  21.         for(int i = 0; i < mapi.length; i++){
  22.             for(int j = 0; j < mapi[i].length; j++){
  23.                 switch(mapi[i][j]){
  24.                 case 0:
  25.                     c[i][j] = new Cube(25, 25, Color.GRAY, x, y);
  26.                     break;
  27.                 }
  28.             }
  29.         }
  30.     }
  31.    
  32.     public Cube[][] getCubeMap(){
  33.         return c;
  34.     }
  35.    
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement