import ChunkGenerator from './chunk-generator';

const TILE_TYPES = [
    'B03', 'F22'
];

export default class Chunk {
    constructor(id) {
        this.id = id;
        let bounds = {
            upperLeft: {
                x: (32 * -50),
                y: (32 * 50)
            },
            lowerRight: {
                x: (32 * 50),
                y: (32 * -50)
            }
        };
        let generator = new ChunkGenerator(TILE_TYPES, bounds);
        this.tiles = generator.generate();
        this.players = new Set();
        this.updates = [];
    }

    serialize() {
        return {
            id: this.id,
            tiles: this.tiles
        };
    }
}

@@ -88,91 +88,438 @@
 %5D;%0A%0A
-export default class Chunk %7B%0A    constructor(id) %7B%0A        this.id = id;%0A        le
+const FIXED_CHUNKS = %7B%0A    spawn: %7B%0A        generate() %7B%0A            return %5B%5D;%0A        %7D%0A    %7D%0A%7D;%0A%0Aexport default class Chunk %7B%0A    constructor(id) %7B%0A        this.id = id;%0A        this.players = new Set();%0A        this.updates = %5B%5D;%0A%0A        let generator;%0A        if (FIXED_CHUNKS.hasOwnProperty(id)) %7B%0A%0A            generator = FIXED_CHUNKS%5Bid%5D;%0A            this.tiles = generator.generate();%0A%0A        %7D else %7B%0A%0A            cons
 t bo
@@ -539,16 +539,20 @@
         
+    
 upperLef
@@ -552,24 +552,28 @@
 pperLeft: %7B%0A
+    
             
@@ -599,32 +599,36 @@
                 
+    
 y: (32 * 50)%0A   
@@ -640,11 +640,19 @@
     
+   
+ 
 %7D,%0A
+    
     
@@ -681,32 +681,36 @@
                 
+  
+  
 x: (32 * 50),%0A  
@@ -703,24 +703,28 @@
  (32 * 50),%0A
+    
             
@@ -749,26 +749,34 @@
             
+ 
-%7D%0A
+   %7D%0A    
         %7D;%0A 
@@ -774,35 +774,35 @@
      %7D;%0A        
-let
+   
  generator = new
@@ -838,16 +838,28 @@
 ounds);%0A
+%0A        %7D%0A%0A
         
@@ -897,69 +897,8 @@
 ();%0A
-        this.players = new Set();%0A        this.updates = %5B%5D;%0A
     

create a system for fixed chunks like spawn town