package common.model;

import common.util.Facing;
import common.util.Facing.Axis;

public interface ModelProvider {
	Model getModel(String primary);
	Model getModel(Transforms transform, String ... layers);
	Model getModel(Model parent, Transforms transform);
	Model getEntityModel();
	
	public static class DummyModel extends Model {
		public Model noOcclude() {
			return this;
		}

		public Model uvLock() {
			return this;
		}

		public Model rotate(ModelRotation rot) {
			return this;
		}

		public Model add(float x1, float y1, float z1, float x2, float y2, float z2) {
			return this;
		}

		public Model noShade() {
			return this;
		}

		public Model rotate(float x, float y, float z, Axis axisIn, float angleIn, boolean rescaleIn) {
			return this;
		}

		public Model face(String texture, Facing... faces) {
			return this;
		}

		public Model cull(Facing cull) {
			return this;
		}

		public Model tint() {
			return this;
		}

		public Model rot(int rot) {
			return this;
		}

		public Model uv(float x1, float y1, float x2, float y2) {
			return this;
		}
		
		public String getPrimary() {
			return "";
		}
		
	}

	public static class BlockModelProvider {
		private static ModelProvider provider = new ModelProvider() {
			public Model getModel(Model parent, Transforms transform) {
				return new DummyModel();
			}
			
			public Model getModel(Transforms transform, String... layers) {
				return new DummyModel();
			}
			
			public Model getModel(String primary) {
				return new DummyModel();
			}
			
			public Model getEntityModel() {
				return new DummyModel();
			}
		};
	}
	
	public static void setProvider(ModelProvider provider) {
		BlockModelProvider.provider = provider;
	}
	
	public static ModelProvider getModelProvider() {
		return BlockModelProvider.provider;
	}
}
