package edu.wisc.cs.games10.chrononaut;

import java.util.*;
import processing.core.*;

public abstract class Enemy extends SimpleMovable {
	public abstract void render(PApplet canvas);
	public abstract void update(float time, Era era);
	public abstract void kill();
	public abstract void attack(Era era, Player player, float time);
	
	private static Map<String, PImage> loadedImages = new HashMap<String, PImage>();
	protected static PImage getImage(String path, PApplet canvas) {
		if (loadedImages.containsKey(path)) {
			return loadedImages.get(path);
		} else {
			PImage image = canvas.loadImage(path);
			loadedImages.put(path, image);
			return image;
		}
	}
}
