Thread: Map data packer/unpacker

Results 1 to 4 of 4
  1. #1 Map data packer/unpacker 
    ̿ ̿̿ ̿̿ ̿̿̿'̿'\̵͇̿̿\=(•̪

    Dragonking's Avatar
    Join Date
    May 2008
    Posts
    2,011
    Thanks given
    16
    Thanks received
    31
    Rep Power
    567
    i realy need the mapdata packer thing... the one used for espeon i cant find it iv spent like 2 hours looking does anyone have it?

    this is the java file in espeon

    Code:
    package net.com.espeon.world.mapdata;
    
    import java.io.DataInputStream;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.util.HashMap;
    import net.com.espeon.util.*;
    
    
    public class MapData {
        
            private static HashMap<Integer, int[]> mapRegions;
            private static int mapId;
    
        public int mapData[] = new int[4];
    
        public int[] getMapData(int region) {
            return mapRegions.get(region);
        }
    
            public void loadRegions()
        {
            try {
                                 DataInputStream in = new DataInputStream(new FileInputStream("./data/mapdata/1.dat"));
                                 do {
                       int i = in.readInt();
                       if(i == 0) {
                        break;
                       } else
                       if(i != 0) {
                           mapId = in.readInt();
                           for(int data = 0; data < 4; data++) {
                            mapData[data] = in.readInt();
                           }
                       }
                                                            
                       mapRegions.put(mapId, new int[]{ mapData[0], mapData[1], mapData[2], mapData[3]});
                     } while(true);
            }
            catch(IOException ioe) { ioe.printStackTrace(); }
        }
    
        static {
            mapId = 0;
            mapRegions = new HashMap<Integer, int[]>();
        }
    
    }
    so does anyone have it?
     

  2. #2  
    You only get one shot.

    `Lubricant's Avatar
    Join Date
    Jun 2008
    Age
    29
    Posts
    1,611
    Thanks given
    96
    Thanks received
    86
    Rep Power
    126
    Code:
                                 DataInputStream in = new DataInputStream(new FileInputStream("./data/mapdata/1.dat"));
                                 do {
                       int i = in.readInt();
                       if(i == 0) {
                        break;
                       } else
                       if(i != 0) {
                           mapId = in.readInt();
                           for(int data = 0; data < 4; data++) {
                            mapData[data] = in.readInt();
                           }
                       }
                                                            
                       mapRegions.put(mapId, new int[]{ mapData[0], mapData[1], mapData[2], mapData[3]});
                     } while(true);
            }
            catch(IOException ioe) { ioe.printStackTrace(); }
        }
    
        static {
            mapId = 0;
            mapRegions = new HashMap<Integer, int[]>();
        }
    
    }
    dere u go pal



    Neuro-X Supporter
    Helios Supporter
    Matrix RSPS Supporter
     

  3. #3  
    ̿ ̿̿ ̿̿ ̿̿̿'̿'\̵͇̿̿\=(•̪

    Dragonking's Avatar
    Join Date
    May 2008
    Posts
    2,011
    Thanks given
    16
    Thanks received
    31
    Rep Power
    567
    no i need the thing that packs it...
     

  4. #4  
    Community Veteran



    Join Date
    Jan 2008
    Posts
    3,444
    Thanks given
    46
    Thanks received
    973
    Rep Power
    4748

     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •