public void loadTerrain(String file)
	{
		int r, g, b;
		int width, height;
		Scanner sc;
		
		try {
			sc = new Scanner(new File(file));
			sc.nextLine();
			sc.nextLine();
			width = sc.nextInt();
			height = sc.nextInt();
			sc.nextInt();
			tmap = new Terrain[height][];
			for (int i=0; i<height; ++i) {
				tmap[i] = new Terrain[width];
				for (int j=0; j<width; ++j) {
					r = sc.nextInt();
					g = sc.nextInt();
					b = sc.nextInt();
					tmap[i][j] = Terrain.fromRGB(r, g, b);
					
					
					ResourceType rt = ResourceType.fromRGB(r, g, b);
					if (rt != null) {
						addObject(j, i, new Resource(rt));
						continue;
					}
					
					MapBuildingType mbt = MapBuildingType.fromRGB(r, g, b);
					if (mbt != null) {
						//System.out.println("("+r+","+g+","+b+") ("+i+","+j+","+mbt.name+") ");
						addObject(j, i, new MapBuilding(mbt, null));
						continue;
					}
					
					CastleType ct = CastleType.fromRGB(r, g, b);
					if (ct != null) {
						addObject(j, i, new Castle(ct, null));
						continue;
					}
				}
			}
			sc.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}