All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pepsoft.worldpainter.FlatTileFactory Maven / Gradle / Ivy

There is a newer version: 2.23.2
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.pepsoft.worldpainter;

import org.pepsoft.worldpainter.heightMaps.ConstantHeightMap;

import java.io.IOException;
import java.io.ObjectInputStream;

/**
 *
 * @author pepijn
 */
@Deprecated
public class FlatTileFactory extends HeightMapTileFactory {
    private FlatTileFactory() {
        super(0, null, 0, 0, false, null);
        height = 0;
        throw new UnsupportedOperationException("Only exists for deserialising old worlds");
    }

    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        
        // Legacy support
        if (getHeightMap() == null) {
            setHeightMap(new ConstantHeightMap(height));
        }
    }
    
    private final int height;

    private static final long serialVersionUID = 2011032901L;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy