Dynamic object creation with HashMap
- by Salor
I want to use a HashMap to dynamically create objects based on the key.
I have a Random Map Generator that stores the maps in 3D Arrays of Type Integer[][][]. Upon creation of the actual map I iterate through this array and based on the Integer I want to create the right block.
Example: Integer[][][] map ... map[6][6][6] = 3; 3 is a Earth-Block…